471,603 Members | 1,508 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

pseudo-element [first-letter] Reset and/or two different colors

<STYLE type="text/css">
P { font-size: 10pt; color:#000;}
P:first-letter { font-size: 150%; color:red; font-weight: bold; float: left }
</STYLE>

Later, I want the first letter to be color:green.

And still later, I don't want the first letter to be 150%. I want it to be reset to 10pt

If I add another <STYLE later in my html to change the color to green, all the first letters change to green - even those above the new <STYLE

I have searched the web and I can't find out how to reset the <p> back to what it would be if I hadn't used first-letter.

I am new to CSS (as you can tell from the question) and I don't care for the fact that it doesn't have a 'don't do that any more' tag. I expected </P:first-letter> to end the inheritance, but it didn't.
Nov 2 '07 #1
2 1914
eWish
971 Expert 512MB
Welcome to TSDN sehodge!!

Instead of applying the font size and color to every occurance of <p> you can do it for certian ocurances.

--Kevin
Nov 2 '07 #2
drhowarddrfine
7,435 Expert 4TB
I don't care for the fact that it doesn't have a 'don't do that any more' tag.
CSS is not a programming language. To modify behavior, a programming language is needed. Look into javascript
Nov 2 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by James Stroud | last post: by
1 post views Thread by imani_technology | last post: by
1 post views Thread by Erik Wahlstrom | last post: by
1 post views Thread by Steven T. Hatton | last post: by
1 post views Thread by rudderstick | last post: by
70 posts views Thread by Ben Pfaff | last post: by
3 posts views Thread by yawnmoth | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.