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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't change inherited styling 2

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
hello all,

I have a div of id 'pagefooter' i have created the following CSS rule
Code:
#pagefooter p {
    line-height:16px;    
    font-size:0.6em;
    font-style:italic; 
    text-align:center;}

however one of the paragrapghs i want a different font size, so have coded <p class="myclass"> , but it refuses to apply the myclass styling and just applies the global <p> styling?

why won't it apply the class to the paragraph I want?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Which style comes first in the CSS file ("myclass" or "#pagefooter p")?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
try
Code:
#pagefooter p.myclass { ...
See thread215-1307992 for Vragabond's brief explanation of specificity and some helpful links.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
thanks guys.

knew it'd be something silly :)

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
hmm i might be a star wars child, but i found the other post confusing enough without adding siths , storm troopers and darth vader into the mix.

basically # beats . and . beats <element>

so if you apply #whatever {color:blue;}

and within #whatever you have a class you cannot just use .myclass to override, you must use #whatever.myclass {color:green;}

why these people can just say it like it is instead of confusing us poor mortals is beyond me.

it took me a few days and a good kicking from Vragabond before i got my head round margin collapsing.

I guess I must be thick!


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top