OZONE Asylum
Forums
Site reviews!
redone site open for comments
This page's ID:
10440
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
Yes, that's correct. You're catching on quickly, aren't ya? ;) Ooh, and before I forget, here's a few more ways to select elements... In addition to the "class" attribute, there's also an "id" attribute, which can be used exactly once on each page (unlike "class," which can be used as many times as necessary). The ID selector is most often used to position the main layout <div>s. For example, <div id="menu">, <div id="content">, <div id="footer">, etc. Of course those divs can be named whatever you wish. The way you select it is with the pound sign. To select, <div id="menu">, for example, you would use this in your CSS: [code] #menu { ...do something... } [/code] Cool? We're not finished yet. One of the most useful selectors is the "contexual" selector, also known as the "descendent" selector. Basically, you can use it to select any particular element, but only when they appear in another particular element. Take this code for example: [code] p a { color: #00ff00; } [/code] What this does is select any <a> element within a <p> element, and make the link text green. You can list as many elements as you want, seperated by spaces, as a contextual selector. To recap: [b]Plain ol' selectors:[/b] <address> // address {} selects all <address> elements [b]Class selectors:[/b] <p class="fineprint> // p.fineprint {} selects all <p>s of the class "fineprint" // or // .fineprint { color: #000; } selects [i]any[/i] element of the class "fineprint" [b]ID selectors:[/b] <div id="content"> // #content {} selects the element with the id="content" (there should only be one) [b]Contextual Selectors:[/b] <address><a href="#">blah</a></address> // address a {} selects <a> elements, but [i]only[/i] if they appear in an <address> And finally, any of the above selectors can be combined. The possibilities are endless. Take this: [code] #content div.float .red a { color: #00ff00; } [/code] The above code selects any <a> elements, that appear within any element with class="red", that appear in any <div> element with class="float", that appears in the element with id="content" Whew. That's enough for now. :p [img]http://omnizero.home.comcast.net/asylum/sigs/003.gif[/img] [This message has been edited by ozphactor (edited 09-17-2003).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »