Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header Color 2

Status
Not open for further replies.

tvbruwae

Programmer
Aug 9, 2001
224
EU
Hi

Is it possible to display headers in a specific color by using a &quot;color&quot; parameter in the <h2> tags?

Thanks
 
Try inserting this in your HTML-file
Code:
<style>
h2 {
    color:#123456
}
</style>

...

or you could do this, I guess:

Code:
<h2><font color=#123456>some text</font></h2>
 
If you put it in your style-sheet like Jonax said , all your <h2> headers will be with that color.

If you want only some specific red h2-headers:

<style>
h2.redh2 {
color:red
}
</style>

<h2 class=&quot;redh2&quot;>my header text</h2>

(of course you can specify a colornumber '#123456' instead of a colorname 'red')

Now you can make also other colored h2-headers with

h2.greenh2 etc. etc.

Look for more CSS-properties by IE4 at thread215-113187

Erik



 
This is probably the best introduction to styles I've found so far... ;-)

Thanks a lot.
 
Oh yeah, by the way...
We both (Boomerang and I) forgot the trailing semicolon (;) after the color tag as in:

Code:
<style>
h2 {
    color:#123456;
}
</style>

This isn't so bad when you only set one parameter, but if you set more than one as in:

Code:
<style>
a {
    color:#123456;
    text-decoration: none;

}
</style>

it won't acknowledge the second if the semicolon is missing...
This is not a bug - it's an undocumented feature...
;-)
 
I'd only been testing with a single feature so far, but I'll need the &quot;;&quot; soon. Thanks for the update.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top