Page 1 of 1

I need a little CSS help

Posted: Wed Mar 16, 2005 5:28 am
by AGISB
I try to replace following font tag in a text line that is not static

Code: Select all

<td class=heading>This is a <font color=red>red</font> Word in the text</td>
The font tag should be replaced by CSS but I cannot come up with how.

If I use<div> around it it does linebreaks.

Any of you know any tag I can use or a way to get a CSS solution?

Posted: Wed Mar 16, 2005 5:55 am
by Chris Corbyn
Use span instead of div :wink:

Posted: Wed Mar 16, 2005 5:16 pm
by Ambush Commander
Also note that there is no such attribute COLOR in span, you have to use STYLE="color:red";

Posted: Wed Mar 16, 2005 6:11 pm
by ast3r3x
w3schools!

Go through this CSS tutorial, you'll learn a lot. You'll also wish you never used tags like <font>. I'd also really recommend NOT putting <span style="whatever">

Learn to use style sheets, they allow you to easily change the look whimsically without any major code changes.

Just an example, look how easily I can change how my navigation works/looks on every page just by changing the stylesheet. Keep in mind that although I used a similar image, I changed the layout, alignment, font, background, and size.

http://www.swigg.net:2222/index.php
http://www.swigg.net:2222/index_orig.php

PS: I was hesitant at first to learn/use CSS because I thought dynamic code spit out by PHP was good enough, but it's not 1/10 as elegant of a solution as CSS, and CSS allows for the rollover effect on those pages. Both the blue and grey images are just a 1px wide image that I stretched...that really helps load time.