OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
Inline style vs. style sheet
This page's ID:
27240
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
Ok. I do have one concern with CSS and thought the solution was an inevitable use of styling at the child element level in your mark up. Let me explain further: The problem (an example): You can not define a color at the top of a css stylesheet then reference this color in your css. So you might want to create a color called "Site_Background_Colors_Dark". Then you might have a div element which you'd like to fill with this color so, background-color: #$$Site_Background_Colors_Dark$$ Supposed Solution: Create a generic class called Site_Background_Colors_Dark with adequate css to color the backround accordingly. In your mark up do something like this: <div id="news_today" class="Site_Background_Colors_Dark"> ... </div> Going a little further, we would like to specifiy the font color for this particular background color so our markup becomes... <div id="news_today" class="Site_Background_Colors_Dark font_color_on_dark_background"> ... </div> Then lets say in our news_today section we have news which is considered important if the news occurs in your town so you'd add to this element more and would have.... <div id="news_today" class="Site_Background_Colors_Dark font_color_on_dark_background important_local_new"> ... </div> Can you see where I am going with this? Anyhow, this is what I was starting to do in my HTML Markup, well that and I was starting to add a lot of style=" ... " definitions too. Enough said. I am now trying to avoid these type of base class defs. Please verify that it is important to avoid such. DL-44 Wrote: [quote]So you are more or less correct, Karl, but it's all in how you set it up. The idea is to keep your mark-up as clear as possible, which means using less class names on child elements - using the class or id of the parent element to define the styles of the elements within them.[/quote] This is what I supposed, that an ID should be unique for the entire markup. I do see the use and value of arranging stylesheets and styles like this. I've already improved the current stylesheet I am working on. Thanks DL-44. Karl.. [small](Edited by [url=http://www.ozoneasylum.com/user/1249]Karl[/url] on 01-08-2006 20:23)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »