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
You can do what you are trying to do, but not the way you are trying to do it. As was said above, and ID can only occur once in your html. So, having two items both with id="8877" will cause a multitude of problems. However, you can use CLASS repeatedly, and any item can have more than one class. So, you can define the main styles for the item in one class, and any styles that might change based on other factors in another. Thus you could have <div class="8877" class="shoppingCartItem"> displays item in side bard shopping cart style</div> <div class="8877" class="itemDisplay"> displays the item in the center of the page</div> Which would give both <div>'s the styles that are associated with class ".8877" and each item the specific styles for the .shoppingcartitem and .itemdisplay respectively. Now, this part Im; nit entirely certain on, but I believe that if you have conflicting style specifications, the value in the *last* listed class is predominant. So, if you specified - .8877 { color:blue; } and .shoppingCartItem { color:red; } Since class="shoppingCartItem" is the last class listed in the <div> tag, the color would be red. Make sense? [url=http://in-dented.com/sigs.html] [img]http://in-dented.com/sigs/indentsig.gif[/img] [/url] [This message has been edited by DL-44 (edited 01-27-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »