nate koechley's blog

http://nate.koechley.com

Feb
20
2004

Trackback or comment.

Find citations on Bloglines or Technorati. View blog reactions

By category: Front End Engineering.

Adactio says that they’ve started added an ID to the body tag of their various page types. This way that can have all their CSS in one file, and still maintain different looks for different page types.

So i guess the CSS would look like this.

<style>
#toppage h1 {
     font-family:arial;
     font-size:2em;
}
#internal
page h1 {
     font-family:verdana;
     font-size:.83em;
}
<body id=”toppage”>
<h1>Welcome to Yahoo</h1>
</body>

<body id=”internal
page”>
<!– maybe a news article page –>
<h1>Kerry narrowly wins Wisconsin</h1>
</body>

Seems like an interesting approach. We’ve alreayd been doing this, but making the selector-ceiling various container divs instead of utilizing the body tag itself.

One Response to “The C in CSS”

  1. Why is having everything in one big file good? Wouldn’t it make more sense to simply include the styles that you actually use in the file and use server side includes to build special things?

    I’m not opposed to including id tags for various items since that allows future modifications, including script and DHTML, but I don’t think that bloating CSS files is really all that good an idea either.

Leave a Comment

Comments are held for moderation so I can manually delete spam not caught by the filters.