...

View Full Version : controlling letter colors in text via css



banpro
01-20-2004, 11:57 PM
Okay, maybe I'm dense but here's what I have so far and what I'm trying to do:



h1 {
font-size: 22pt;
color: #000098;
font-weight: 200%;
margin: 0px 0px 15px 5px;
}


What I want to do is modify this so that the first letter of every word within the h1 element is red (#980000)?

I thought some variant of first-letter or something would work but it only applies to the first letter of the first word in the h1 element, I need to apply the red coloring to every word's first letter and really don't want to use font tags within the HTML.

Any suggestions are appreciated, thanks,
Scott

mindlessLemming
01-21-2004, 12:24 AM
The only way I can see this working in all the bad browsers would be to nest a <span> inside your <h1> w/ the first letter of the word in the span.
Horrible way of going about it, but effective.


h1 {
font-size: 22pt;
color: #000098;
font-weight: 200%;
margin: 0px 0px 15px 5px;
}
h1 span{
color:#980000;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum