Click to See Complete Forum and Search --> : How do you change color of one word within a Heading in html


dandmeveritt
09-14-2005, 03:05 PM
How do I change the color of one word within a heading or withing the body in html?

HaganeNoKokoro
09-14-2005, 03:10 PM
Example:<h1>Blah blah <span style="color:#ff0000">blah</span> blah</h1>

tabzter
09-14-2005, 06:45 PM
Heres a more general way using CSS:

put the following code in between the <head> sections of your html
<html>
<head>
.......
<style>
#myStyle{color:blue;}
</style>
.......


now where ever in the document - whether it be a heading tag, table tag, form tag or whatever - put the following tag in your code
Hi Kids, my name is <span id="myStyle">Tabzter</span> and I am your worst nightmare, hahahahaha.

HaganeNoKokoro
09-14-2005, 06:51 PM
If I were doing it like that, I'd use .myStyle instead of #myStyle so I could use it with class="myStyle" in more than one place (ids must be unique).

tabzter
09-14-2005, 07:10 PM
yes HaganeNoKokoro is definitelly right. For some reason it slipped my mind for a sec.

Good Spotting, HaganeNoKokoro

Charles
09-14-2005, 07:25 PM
However, if you are trying to add emphasis then use:<h4>Being <em>and</em> Time</h4>

But if you are trying to diminish:<h4>Being <small>and</small> Time</h4>