OZONE Asylum
Forums
Site reviews!
Nothing Special
This page's ID:
27321
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
Good to hear =) To offer a little clarity (hopefully) on the issue of class vs. id - When you look at the structure of your site, you want to isolate those elements that are the basic building blocks of your site. These are the elements that will be present on each page, but are unique within the page itself - navigation area, header, main content area, footer, etc. These are the types of elements you will generally give ID's to. This ID can only be assigned to one element on a given page (for instance, you cannot have 2 divs both having the id of 'header'. You cannot have a div and p both the id of 'head', etc...). From there, you want to look at each of those areas and determine what structural elements you will use within them. Inevitably, you will find that you want to use certain elements in a given area, but you will want them styled differently when they are within that area than when they are in a different part of the page. That's when you use constructs like this in your CSS (exaxmple pulled from my version of your page) - [code] #nav ul, #links ul { margin:0; padding:0; border-top:#007473 2px solid; } [/code] Rather than add more code to your markup, you tell the browser that when a <ul> appears within the element with an id of 'nav' or 'links', apply those styles instead of the default. Using this method (as opposed to creating a seperate class for the ul element) will keep your mark-up cleaner, and make updating easier. Then, of course, you will have elements that you will want to be styled the same no matter where they are. In this case you simply set the style for that element in your CSS. And then, lastly, you will elements that you will want to treat differently at diffferent times, not dependent on the parent element. This is when you use a class. A class can be applied to any number of elements any number of times. For instance - you have a class specified in your CSS with styles related to font colors, borders, or whatever else. You can use that class on any element that you want to have those attributes - they will apply equally whether you are coding a list, a paragraph, a link, a div, a table, etc... In the example I posted above, there are no classes used because they were not necessary to get the desired effect. You may certainly find need for them as you add or modify the design, however. Hope that helps... [url=http://in-dented.com/sigs.html][img]http://in-dented.com/sigs/knot_sig_32.gif[/img][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/163]DL-44[/url] on 01-26-2006 01:30)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »