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']}"; } ?> Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/ 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>"; } ?> Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/#findComment-876912 Share on other sites More sharing options...
sandbudd Posted July 17, 2009 Author Share Posted July 17, 2009 get a blank page Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/#findComment-876914 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." Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/#findComment-876915 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 Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/#findComment-876916 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. Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/#findComment-876917 Share on other sites More sharing options...
sandbudd Posted July 17, 2009 Author Share Posted July 17, 2009 amtran worked great thanks guys Link to comment https://forums.phpfreaks.com/topic/166288-solved-chance-font/#findComment-876918 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.