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 I cannot do the following mid page? <body><style... I have code like that running on some of our pages and both IE 5.1 up and Netscape 7 seem to be applying the styles." Right. You should not be doing that. The browsers are merely being unnecessarily lenient. "If I am not supposed to do things like that how can I apply style changes within the body?" Style sheets should not be changing while the body of the document is parsed. By using classes and ids, along with thought-out selectors (such as #sidebar p {...} for paragraphs in one part of the page, and #content p {...} for paragraphs in another, etc), you have enough power to specify all of the styles for the page all at once. "Is it nessesary to manage all of my CSS code in one master file/location and do any CSS style changes within the actual tag of the module I want to change?" For standards-compliance, yes. All CSS must be either in the <head> or linked (from the head) with a <link> tag or an @import css rule. Importing files into a document which require CSS is a headache. In some circumstances, you can separately import the CSS that they need into the head of the document. Sometimes you do have to resort to the style="..." HTML attribute, although it's messy and discouraged. "So if I had a <p> in a module and I wanted that one paragrah styled differently because the element contained matched word from a search request I would do this: <p background-color:#cc9900;> or would I have to have the different style defined within the head and I just call that class when I find a match? <p class=searchFound>" The latter option is the best idea. Do things like that when possible.
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »