sandbudd Posted July 17, 2009 Share Posted July 17, 2009 hey guys how do I change the font style and color...it displays the information fine just need to change color and style. <?php $query = "SELECT * FROM washington_description"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "{$row['description']}"; } ?> Quote Link to comment Share on other sites More sharing options...
d.shankar Posted July 17, 2009 Share Posted July 17, 2009 Try this. <?php $query = "SELECT * FROM washington_description"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "<font face='verdana' color='red'>".$row['description']."</font>"; } ?> Quote Link to comment Share on other sites More sharing options...
sandbudd Posted July 17, 2009 Author Share Posted July 17, 2009 get a blank page Quote Link to comment Share on other sites More sharing options...
Amtran Posted July 17, 2009 Share Posted July 17, 2009 Though I would recommend using Cascading Style Sheets, you can also do this in lieu of more work: <?php $query = "SELECT * FROM washington_description"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo '<span style="font-family:courier;color:red">' . $row['description'] . '</span>'; } ?> EDIT: d.shankar, the <font> tag works, but it's been depreciated as of HTML 4 by the W3C because "CSS will be used for absolutely everything." Quote Link to comment Share on other sites More sharing options...
d.shankar Posted July 17, 2009 Share Posted July 17, 2009 Try my edited code or use amtran's Quote Link to comment Share on other sites More sharing options...
d.shankar Posted July 17, 2009 Share Posted July 17, 2009 d.shankar, the <font> tag works, but it's been depreciated as of HTML 4 by the W3C because "CSS will be used for absolutely everything." I never knew that I use that in all my codings May be i need to switch. Thanks for the info. Quote Link to comment Share on other sites More sharing options...
sandbudd Posted July 17, 2009 Author Share Posted July 17, 2009 amtran worked great thanks guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.