OZONE Asylum
Forums
CSS - DOM - XHTML - XML - XSL - XSLT
Scroll Bar Color for scrollable DIV
This page's ID:
28197
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
[quote] [b]Karl said:[/b] How do you select a div element who's ID is "MIDDLE" with a class of "bg_Image1"? Reason? CSS has 2 definitions for #MIDDLE, first definition when #MIDDLE has class of "bg_Image1" and second definition when #MIDDLE has class of "bg_Image2". I am dynamically setting the class for this element, the consistent part is that the element's ID is #MIDDLE. [/quote] Let's clarify: There are *not* 2 definitions for #middle; there is one definition for #middle, and also a definition for .bg_Image1 and one for .bg_Image2. #middle in the CSS defines the attributes for anything with id="middle" in the HTML. .bg_Image1 in the CSS defines the attributes for anything with class="bg_Image1" in the HTML. And so on. So define the basic attributes for #middle in the CSS - the things that won't need to change depending on the class. Then define the things specific to the classes using the .bg_Image1 and .bg_Image2, making sure they are listed after the definition of #middle in your CSS. You don't actually determine in the CSS that the element will have both an ID and class, or that it will have multiple classes. You define each separately, and if both are declared in the HTML, then both sets of attributes will be applied (with those listed last in the CSS superceding any conflicting setting which precede them). For the record: those are terrbile id and classnames. They offer no meaningful hint as to their purpose, and the combination of underscores and capital letters is just begging for typo's ;) [url=http://in-dented.com/sigs.html][img]http://in-dented.com/sigs/knot_sig_32.gif[/img][/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »