OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
CSS to change text color
This page's ID:
27249
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I'm not entirely clear on what you're asking, or what you mean by "dynamically". The short answer is - you can specify any style attribute of any element pretty much any way you want with CSS. That's the whole idea. The question becomes - why do you want to change the color? What is the default color? Are there more places than this one spot where you want the same effect? Etc... The basic approach would be something like this - the CSS - [code] .blockheader { color:grey; } .blockheader span { color:blue; } [/code] The HTML - [code] <div class="blockheader">Who's <span>online?</span></div> [/code] Depending on what the ultimate goal is, you may want or need to add a class to the <span> as well. Or you may want to use one of the preset HTML tags, like <em> or <strong> to specify the color blue (beleive it or not, <em> does not mean italic, and <strong> does not mean bold ;) ) - [code] .blockheader { color:grey; } .blockheader em { color:blue; } [/code] The HTML - [code] <div class="blockheader">Who's <em>online?</em></div> [/code] You would *NOT* want to use a scheme like you proposed, where you have tags within the HTML that actually dictate the style. Otherwise we're right back to the <font> tag and there's no point to using CSS at all... [url=http://in-dented.com/sigs.html][img]http://in-dented.com/sigs/knot_sig_32.gif[/img][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/163]DL-44[/url] on 01-04-2006 05:45)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »