On 30-Sep-07, at 9:20 PM, Don Stefani wrote:
> While testing out a web building IDE I noticed this about the
> generated CSS:Putting
> a class in the body tag and then using that to preface every
> declaration in
> the style sheet.
>
> IE:
>
> .bodyClass #header #nav #navlist { ...
>
> Is this done to insure that older browsers will follow the path to the
> markup and css?
Don,
The practice, of attaching a class to the body tag is usually done to
style different sections of a website differently. I do not think
that it affects different browsers differently.
For example, on your home page, if you have <body class="bodyIndex">,
and on your about page you have <body class="bodyAbout">, then, using
the following rules, you can highlight different sections of your
navigation, depending on where you are.
HTML
<ul id="nav">
<li><a href="index.html" id="index">Home Page</li>
<li><a href="about.html" id="about">About Page</li>
</ul>
CSS
.bodyIndex #nav #index, .bodyAbout #nav #about { color: pink; text-
decoration: none;}
This would make the index link pink, if you were on the index page,
and the about link pink on the about page. And so forth. I use the
same technique on this site, to serve different header images to
different pages:
http://cfl.in/index.php
Hope that helps,
- Rahul.
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/