OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
class VS id what is the difference
This page's ID:
10895
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
"So the intepretation of the following is different: <div class="id8877 shoppingCartItem"></div> <div class="shoppingCartItem id8877"></div>" No. DL-44 said it was different, I corrected him, saying it was not. Those two divs are equivalent. "Now if in the page in the following order I say: 1. item8877 {color:blue;} 2. <div class="item8877">blue</div> 3. item8877 {color:red;} 4. <div class="item8877">red</div>" You can't say that. Style sheets are only allowed in the HEAD of the document, and visual elements are only allowed in the BODY. I wouldn't be surprised if IE let you do that anyway, but you shouldn't, and there's no specification that details what happens in that case. However, if your style sheet in the head contained the following: .item8877 {color:blue;} .item8877 {color:red;} then any element with class="item8877" would have red text; the later CSS properties overrule the earlier ones.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »