Topic: CSS to change text color (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: las vegas, nevada, us |
posted 01-04-2006 01:11
ok I know there is a way to change the back ground of a link |
Lunatic (VI) Inmate From: under the bed |
posted 01-04-2006 05:43
I'm not entirely clear on what you're asking, or what you mean by "dynamically". code: .blockheader { color:grey; } .blockheader span { color:blue; }
code: <div class="blockheader">Who's <span>online?</span></div>
code: .blockheader { color:grey; } .blockheader em { color:blue; }
code: <div class="blockheader">Who's <em>online?</em></div>
|
Obsessive-Compulsive (I) Inmate From: |
posted 01-04-2006 13:43
Don't forget your CSS2.1 selectors; you can't specify the first word, but you can select the first line or letter. Not that IE cares, but in case you did. |
Paranoid (IV) Inmate From: Florida |
posted 01-04-2006 18:53
quote:
|
Paranoid (IV) Inmate From: Mexico |
posted 01-04-2006 19:09
I thught we all were talking about events, like :hover :P |
Obsessive-Compulsive (I) Inmate From: |
posted 01-04-2006 19:35
The question was akwardly phrased, but you can still use pseudoclasses (events, like :hover) and pseudoelements (DOM extensions, like first-letter) together, tmk, just not on the same element. The question was whether you could change the color of text within an element -- the only way to achieve this (without changing the markup) are those pseudoelements. |
Lunatic (VI) Inmate From: under the bed |
posted 01-04-2006 21:02
quote:
|
Lunatic (VI) Inmate From: under the bed |
posted 01-04-2006 21:04
quote:
|
Bipolar (III) Inmate From: las vegas, nevada, us |
posted 01-04-2006 23:59
I guess I was just hoping there was a way for CSS to take a line with two works and make the second word a different color then the first but thinking about it, since I'm pulling the titles from a database I can do it with php. |
Bipolar (III) Inmate From: las vegas, nevada, us |
posted 01-05-2006 00:25
I got it to work with php! |
Paranoid (IV) Inmate From: London |
posted 01-05-2006 10:52
Hey DL I always thought you were American, or do you just like to speak/write the correct English? |
Lunatic (VI) Inmate From: under the bed |
posted 01-05-2006 18:43
Yup, american. |