70 Reader Comments

At Concordia University in Montreal, we actually used to do this (separate the style sheets as you described). In the end, we found it very cumbersome especially with so many sites to work on at any given time.

For example, when we have to style, say, a div. We’d have to edit color.css to change the color of the div, then open type.css to change the font, etc. Things got worse for us when we had to throw in unique homepage styles. Then say, for some reason we had text in a background graphic (not lately, but we used to), then some workers got confused where to find the style.

What we do (now, until I can figure out a better way), is simply organize the stylesheet into sections with a table of contents at the top, e.g., head, body, sidebar sections. We share a common.css with all the websites (to save bandwidth as it would be stored in the browser’s cache), and each has a custom.css to modify any styles. IE5,6, and 7 stylesheets are added on top of that, then finally, print.css.

I’m not really in favour of adding multiple style sheets for the simple reason that it becomes very difficult to track them down when you are editing the page. I have found that I spend more time trying to work out what styles are doing and where they located.

I agree with Rommil, I prefer to have a table of contents at the top of the page and break up the style sheet into sections.

To date I have not found the perfect solution for laying out my styles but thats a work in progress. It is also only very recently that I have started to add browser specific styles as previously it was all about getting it looking the same in all browsers, after all thats what the client wants.

I think having 6+ stylesheets is great and all but the biggest downside for it is you have more and more server requests. Why not organize your stylesheet in a logical manner like I’ve done on my own website? - http://www.nealgrosskopf.com/

As others have mentioned before, separating css files like this is hell. You’re not splitting up 1500 lines of css across 3 files, you’re creating 3 files with 1500 lines of code each. This is hell to maintain.

As for the ‘:’, they can have a function, depending on the context they are used in. It might be good to leave them out of a form, but for a caption/detail structure they are definitely needed when both caption and detail are separated by spans.

Not a big fan of this article, which is pretty basic, lacks focus and preaches the wrong things.

I agree with Aaron and actually implemented something similar on “a project”:http://www.cue-the-sun.com/ato/list.html “I worked on”:http://www.cue-the-sun.com/ato/add.html “a few years ago”:http://www.cue-the-sun.com/ato/view.html.

It certainly can become cumbersome, but I think if you’re strict about breaking up the declarations into different files based on the properties as Aaron mentions, then it’s a logical deduction that if you’re changing font, colour, or other properties, there is an appropriate file for those declarations and so all you have to look for is the id or class handle that calls it.

If elements have clearly identifiable classes and ids, tracking them down is very easy. This system also forces you to think about how to make the CSS robust and reusable, which introduces its own efficiencies.

I think it’s naÃ¯ve to think that the media type only requires different layout styles (as shown in your stylesheet diagram). For instance, I usually specify a serif font (TNR/Georgia) for printed pages because it’s more readable in that format. I’m considering this approach:

* style.css (includes everything needed)
* print.css, screen.css, and other media types: all included from style.css via @media (as shown in this article): These contain all styles unique to the media type
* layout.css, type.css, forms.css, etc: Common styles that work for all media types: Imported from the media types (minor duplication of filenames)

Of course, such a complex structure (like the one in this article) should be compiled down to one stylesheet per media type, plus a common one for common styles included for all media types, minimizing HTTP requests.

I get separating out the style sheets, though I don’t fragment them as much as Aaron does in the article. I’ve found myself going with a single master style sheet - which I minimize if necessary, one for any IE bugfixes, then a print style sheet. I haven’t had any client ask for supporting any browser “lower” than IE6, so accounting for Communicator 4’s acceptance of @import doesn’t factor in at all.

I found the idea of using CSS to render the colons after form labels a gem. I struggled with that thought just last week. From a screen reader perspective, Aaron’s idea makes good sense.

I found useful to use separate stylesheets for both IE6 and IE7, but I don’t think further fragmentation is a good idea. With type.css, layout.css, color.css you’ll end up with 3 times more selectors than if you use only 1 file. If you want to define style of a particular element you have to write definitions on 3 places in 3 files. Also debugging is harder.

I agree with most commenters.
Unfortunately this is not a workable solutions in a lot of cases. Changing a single website module/feature/widget requires you to open 3 CSS files. Considering that you’re making additional HTTP requests as well makes me think one nicely ordered stylesheet with a table of contents does the job a lot better.

I like this method it’s very handy if you want to organize your code. I use it also in my CSS Frameworks, but there is one serious problem -> “HTTP Requests”. There are N.1 problem for the page speed. I think that is great to divide the CSS code in logical parts but in the end you should merge into one for the screen,one for the print .. Also compress if you can!

1.) To split complex stylesheets into reusable modules and to @import {...} them within a central stylesheet is nothing new. For example, the CSS framework “YAML”:http://www.yaml.de/en/ uses this method since more than 3 years now.

On a tiny site with little to style, this many sheets might work. But once you get large enough to care about things like bandwidth and server utilization, having that many style sheets on each page is overwhelming.

However, the principle is sound, and I’ve used a very condensed version of it in my current enterprise position, which is comprised of three style sheets only. One core sheet. One for IE 6 or 7. One unique to each property that overrides some core styles.

Maintenance wise, it’s at the point where I only have to perform modifications to the core sheet, and the IE sheets as needed.

I really would like to see people think for themselves more. You don’t have to do *exactly* what’s suggested. As a Designer (nay, as a human!), it’s up to you to determine the right level of graininess for optimum maintenance.

It’s almost 2009- F Netscape and IE5. As far as multiple stylesheet files, I do try to break them down sometimes depending on the complexity of the site, but usually just into one layout/reset file, and the other a type/color file. Cutting down on http requests is usually my main priority when structuring css. And @import? I threw that away years ago.

This technique doesn’t take performance into consideration at all. Perhaps using multiple style sheets for development is OK if it suits that developer, but honestly why does this matter with firebug telling you exactly where to find the styles in the style-sheet?

Something should be said about using conditional comments to add extra special ‘ie6’ and ‘ie7’ classes and keeping everything in one style-sheet so that it performs much quicker.

Separating style sheets is an inherently good idea, because a large site can easily have 1000+ lines of code, even _without_ print or cross-browser styles. The scrollbar and even Ctrl+F can become your enemy, as may other people working on the same project.

But I have to say, I have no love for the separation into type/colour/layout, because these three are intrinsically linked, and you’ll end up having all three open at all times anyway, moreso because their distinction isn’t always as clear. Colour, for example is both a property of type and of layout, so who could agree on the proper separation of css?

What we do at my place is make a main.css with the complete set of CSS for generic parts and layout for the entire site. Separate CSS files are created per functionality “module”, such as the news section in its entirety, or an online document search interface, or your google maps page.

Functionalty is always easily separable from the rest of the site, and we apply this concept in all code, from css to js to the ASP on the server end.

I toy with the idea of separating main.css into common things like formstyles, user messages etc., and the unique layout of the site at hand, but that’s missing the point, which is to _make maintenance easy_. Once that goal has been reached, further “optimization” leads to over-engineered solutions that can only, excuse the term, suck hard.

On another note, I frowned when I saw mention of Netscape4 and IE5/Mac. I doubt it’s practical to give these browsers more than just a casual though on a lost evening, let alone _support_ them with coding techniques. Both browsers do not exist anymore, and devising ways of supporting them, I think, is a waste of resources. In fact, the lowest browser we support here is IE6. We would love to drop that one as well, but alas.

For heavy lifting, I’m in favour of conditional comments, but otherwise, I’ve never needed more CSS trickery than the well-known _ and * bugs in IE.

I agree with everyone who commented that editing multiple stylesheets after the fact is hell. I personally divide my styles into five sections in a single stylesheet: reset, base elements, universal classes, specific IDs/layout, page-specific overrides. Makes overriding a style extremely straight-forward, too, which hasn’t been mentioned yet. Changing styles isn’t always what you need to do.

It’s also worth noting that putting @import in your stylesheet, aside from increasing HTTP requests, has an additional downside in IE: IE doesn’t cache any stylesheet that’s two layers out. So if you link to main.css, and then have an @import in man.css to screen.css, IE won’t cache screen.css. This won’t matter for most small sites, but in environments where you need to watch your server load and bandwidth it will bite you.

This is good general programming practice (being modular), but creating so many separate style sheets really increases your HTTP request and can significantly damage the load time of you site. From an optimization stand point it’s just more efficient to lump all your CSS into 1 file (same with your javascript, if you can).

A firefox addon was referenced “edit css sidebar” however I cannot seem to find it. The only add on I found has not been updated in quite some time and does not appear to work in ff3. What addon do you use regularly?

Matt Tucker: Look for “Web Developer Toolbar” - it should have what you need and should work in FF3.

As for the article, I tend to agree with everyone else: less CSS files are better for the sake of HTTP requests. We (my company) had a significant difference in load speed and therefore conversion when we grouped our CSS and Javascript stuff.

I was tremendously disappointed by this article. When Fx2, Fx3, Fx3.1, Opera 9.6, IE6, IE7, IE8, Safari, Chrome, iPhone, and Android are all about to share the stage, I was eager to read about progressive enhancement techniques from the Web-capable handhelds to the judicious use of previously unsafe CSS 2.1 and CSS 3 properties where now applicable.

Boy was I wrong! Instead, a litany of hacks to hide CSS for NN4(!) and IE5 Mac, praise for conditional comments as if we haven’t already been using them for years, and some seemingly pointless examples of giving different styles to IE7 and IE6 as if for fun. Why? We’re barely two months from 2009.

This article feels like it was written in late 2005 with sloppy mentions of IE7 hastily added prior to submission.

I still look forward to an article on progressive enhancement relating to the current state of the Web.

I’ve tried separating stylesheets into separate files for layout, colors and text and found that it works great on a small scale.

Throw in conditional styles for IE versions and things get a little more complicated. Most of the rules aimed at IE x.x are related to layout so maintenance only becomes an issue on redesigns. But still, it’s something to consider.

Scale things up to the point where thousands of pages call up to 6 files, and suddenly you’re taking a hit in performance and facing increased bandwidth. Even with caching, you’re still going to see a slower load on the visitor’s first visit to the site. And since first impressions are lasting ones, I want to make sure that first page loads as quickly as possible. Maybe just keeping it simple is the best way to go.

I’d like a CSS Style editor that databases my style choices and automagically generates CSS files and (x)html linkages (separated and conditionally commented as needed) based on the current state of known browser quirks and failings.

“Dirk”:”:http://www.alistapart.com/comments/progressiveenhancementwithcss?page=2#14” (and others) were completely right in calling me out on the @import inside an @media crap, it was a last-minute change I made to the article shortly before publication and which I realized—a little too late—was neither valid or supported (and rightly so). I was looking for a way around the media declaration issue with IE and thought I had found it, but only managed to find *massive fail*. Again, I apologize profusely for not catching it earlier, but I have corrected that now and reverted the article to use my previous method.

_Mea culpas_ out of the way, I’d like to take a moment to address a few other bits and bobs being brought up on the thread:

# *server requests* - yup, this means more server requests which _can_ cause site performance issues, but there are many ways you can reduce that performance hit. CDNs are a good option, but you could also weight the benefits of PE with CSS against your performance needs. Perhaps you don’t need to worry as much about playing a game of “hide the stylesheet” from those _special_ browsers. If that’s true, you should count yourself lucky. Which brings me to…
# *the point of this article* - contrary to what you might think, this isn’t a “check out this nifty trick” piece. In fact it’s not even about trying to convince you to do what I have found works… it’s about getting you to think about how you can apply CSS in a progressively-enhanced way. Thankfully, most browsers in use today have a fairly comparable feature set CSS-wise (or at least they will when IE8 comes out of beta), so PE with CSS isn’t as big a deal as it used to be (since CSS hasn’t gotten an overhaul in quite a few years), but it’s still a good thing to think about, especially since CSS3 is (hopefully) right around the corner.

Define your three-letter-acronyms please. Thanks for the answer, Aaron, but you could expand your acronyms. It’s late and I’m not able to expand them in my head, hurting your intended clarity:
* PE
* CDN

I was very happy and interested into the first part, now part 2 was for me, like others above a bit of a shock. ^-^ I actually cannot and do not want to think about anything before IE6.
I work for social network, so backwards compatibility is absolutely necessary. But we decided to draw a clear line (the bottom is IE 6).
I personally prefer to use 2 to 3 stylesheets (main for screen and print!, IE 6 and if necessary IE7). I used to split stylesheets in colors / backgrounds, typo and layout, but ended up with 1000 lines each, that was not main table.
The idea of using a table of contents is great, and when I will get myself deeper into mobile development (thanx for the links!!) more extra sheets might be interesting.
But I believe the less the better.

*Chris Pond—*
The ALA comment textarea uses Textile for formatting. See the line just above it for a link to documentation and a sandbox.

The comment preview is a tad limited, it seems.

*Matthew Goodenough—*
Colons have been stylistic elements and a “visual cue” since their inception in modern typography, and are not part of content. Putting them in CSS is entirely correct and acceptable. The same goes for periods, capitals, semicolons, quotes, dashes, italics-for-emphasis, large size for headers etc.

In this context, an equivalent alternative to the semicolon, as an example, would be a little extra padding on the right and a small background image to indicate the connection between the label and the field.

I agree that the distinction can get a little hard to enforce, because without all the visual cues we put in text, the content would be very hard to read, and thus it’s odd to not lock them inside the text as though they were content. But here we talk about colons on a label; not colons in a sentence, and taking advantage of CSS is recommendable.

Come, now, Mr. Jeffery! Continuing your logic, the spaces between words themselves are merely “visual cues,” not “content.” After all, Mayan, Olmec, Aramaic, Coptic, Hebrew, Classical Greek, and Phoenician were written for centuries without them. Let’s strip these newfangled presentational elements from the true content, wrap every word in its proper span tag, and let the user agents use pseudoclasses to render the visual cues to the wusses who visit our Web pages, if and only if their browsers prove them worthy!

I don’t think you can support all kinds of browsers and devices if you have a common markup for all. But it can be used in conjunction with the XUL i suppose. So that you always have your data in xml format and it will be common item. Then you can seperate the browsers/devices into groups and create different markups for each group. And at last for each group you can apply progressive enhancement.

@Willem Jeffery - I agree with Jon Zuck: colons, periods, capitals, semicolons, quotes and dashes aren’t stylistic elements, they’re punctuation. However, I don’t have a problem with the CSS content example that Aaron’s used, because a label / input pairing isn’t really a sentence, so it’s debatable whether the colon would be considered ‘content’ or not. (You’d also need to be mindful of labels that are actually questions which would need to end with a question mark rather than a colon.)

Re: editing CSS with the webdev edit CSS pane - does anyone else do this? I imagine it’d be a bit of a chore but maybe that’s because I’ve got used to using programs that autocomplete lines when you type a few characters.

@Aaron - Using a CDN to compensate for the additional http requests doesn’t make sense to me. The network does nothing to reduce the amount of requests. It just adds another DNS lookup into the mix and adds cost to the project for no reason. If I’m not mistaken, the point of a CDN is to have the files served from a location closer to the client.

However, if you merge the CSS files into a single file that is served compressed (as mentioned on earlier comments) you mitigate the performance issues in one swoop.

Having worked on several social networking sites, the shear number of HTTP requests is our biggest enemy. I’ve settled on a modular based approach. Many social networking pages have similar “boxes” of content or modules. We have one common.css file which contains styles used by multiple modules, and then each module gets its own style sheet.

Say several pages list forum topics and have a comment box (like a profile page). It makes sense to have a comments.css and a forums.css file. This greatly reduces the amount of CSS I need to write and maintain, with the additional benefit that simpler pages do not need all the CSS overhead that more complex pages do.

The average page then loads the common file, probably one or two module files, a common print file, and then IE-only style sheets.

I really like the idea of fragmenting styles. It’s tough, though, to decide if the fragmentation should be by topic (fonts, colors, etc.) or by DOM location (header, footer, sidebar, etc.); or by media type, as addressed by this article. The problem, though, is that each new fragment would require another HTTP request. Efficient HTTP caching makes this a moot point for successive requests, but a slow first page load may influence whether successive requests are made (maybe the visitor deems the site too slow and hits the back button).

YSlow preaches the reduction of HTTP requests, suggesting that maybe we should have just one CSS and one JS file for the site, and serve it via CDN. This seems to preclude CSS fragmentation… but not really.

Rails developers have the option of using “SASS”:http://lab.hamptoncatlin.com/play/with/sass (packaged with “Haml”:http://haml.hamptoncatlin.com ) to generate Syntactically Awesome Style Sheets. Styles can be managed in fragmented files (as many as you wish), and compiled into one compressed CSS file—and by “compressed” I mean compacted (one line per selector) or compressed (entire stylesheet on one line).

A clever author could use one stylesheet per media type with virtually no repetition (keeping the fragmented files DRY, folowing the Rails Way). Really, the possibilities with SASS are endless: it even supports color math!

First, I think some are overreacting to Gustavson’s casual mention of NN4 and IE5. My own feeling is that if you want to accomodate user agents going that far back, stick to Quirks+HTML3 but let’s give the author points for being thorough and move on… OK?

What I liked about the article was it’s tone with regards to the need to accomodate IE6 and IE7 as a given, as something which simply must be done at this point in time, period. Just a fact of life.
To some this is completely obvious; a no-brainer. But in other forums, I’ve run into designers and developers who I find are, frankly, near-delusional about this. (IMHO) There’s two memes worming their way through the technosphere:
1) An inflated sense of the installed user base for FireFox - to the point where IE is talked about as if it no longer mattered because “it’s days are numbered”.
2) The belief that there is a magic button that can (and will!) be pushed soon whereby all the remaining IE users (poor saps) will suddenly find themselves using FireFox 3, or Opera 9.6 or Safari for Windows.

Now, whether these ideas turn into sites which no longer look good or behave well with IE6 (or even 7) remains to be seen.
But IE6 has an installed user base of, at a very conservative guess, what, a hundred million users?
Their numbers will dwindle but it will still be some years before we can design confidently without taking IE6 into account. IE7, even longer. No matter how hard Microsoft pushes an upgrade to IE8.
And in the meantime, conditional comments or their equivalents will be the order of the day.

@“Richard Fink”:http://www.alistapart.com/comments/progressiveenhancementwithcss?page=5#49
I donÂ´t think it will take that much longer for IE7 to disappear, than it will take IE6. IE8 installs on the same platforms as IE7 and has the version switch. This makes switching from IE7 to IE8 pretty easy, not like switching from IE6 to IE7. I can even imagine that for that reason IE7 will again have a smaller market share than IE6 in the end. Certainly hope not though.

I agree with a lot of commenters here that splitting all your stylesheets into colour, type and layout is unhelpful. The suggestion that the print styles for any of these three will relate to the screen styles is pretty unimaginative too - on most of my sites, there is very little correlation between type (sans serif for screen, serif for print), colour (may use light-on-dark for screen, not for print - may use background colours on screen, often doesn’t work in print) and layout (print sheet removes most layout styles, and removes some elements completely!).

No, where multiple stylesheets come into their own is when you have a site with a set of generic styles across all pages, but with a different colour scheme for different sections. That is exactly what ALA does! Each edition has a different colour scheme, which keeps all the colours in a separate stylesheet so they don’t clog up the main one.

When CSS can recognise user-defined variables, this may become redundant, or at least less useful, but in the meantime, it’s a very good use for multiple stylesheets.

Having used third party software that utilises multiple stylesheets I have to agree with most of the comments:

1. It’s a maintenance nightmare… 8+ stylesheets!!
2. It will slow down the initial load of the site
3. A CDN is used to serve content based on the (network) proximity of the user requesting the resource - the fewer the network hops to the server the quicker the response time.

There is an “alternative”:http://blog.niccai.com/post/51688182/maintainable-css-using-ie-specific-css-selectors (better?) way of using conditional comments to target specific versions of IE without having to result to multiple stylesheets.

There are lies, dam lies, and statistics but… I’ve access to the log stats of a (non-technical) public facing website and over the last 12 months there has been 1 visitor using IE5(Mac) and none using Netscape 4… I wouldn’t spend anytime designing for those browsers…

This might be worth a look for writing maintainable css “CSS Systems”:http://natbat.net/2008/Sep/28/css-systems/

recent articles have been below par in quality. I think even Sixrevisions and Smashing magazines are getting a lot better. This article really does sounds like it was written in 2005. IE 5.5? Netscape? Which world are we living in? Splitting css into so many files is a maintenance nightmare that I am glad to do without. I use 1 stylesheet and if a page is complicated, I use another style sheet for a specific page when working with sites with more than 30 templates.

I’m really surprised to read this article in _2008_ from somebody as experienced as Aaron. Everybody is trying to _reduce_ HTTP requests these days, and we all know that @import is the *worst, slowest way* to add more stylesheets. Kids, don’t try this at home — you will hurt the web!

Apart from the maintenance nightmare it’s simply superfluous to create extra stylesheets for print, not to mention handheld styles. Usually my print stylesheets just involve setting a few elements to display:none and fixing a few colors and widths. That can be perfectly done in one stylesheets with the @media print rule:

This all sounds really awesome in theory. We are all about separating content and style, so why not break up the styles into logical units as well?

But in practice I don’t know how good this is…
Has anyone come up with actual metrics on whether it’s better to have everything in one css file (large initial size, but only one http request) versus broken up (small individual sizes, but multiple http requests) in terms of bandwidth, and perhaps page loading? If multiple http requests causes the bigger hit, then in many cases the separation is a weakness.

Also, initially it seems good to break everything up into different chunks of style. Typography, layout, color, etc. But, as has been mentioned this can make maintenance, and especially development, hell. Currently, if I want to change an element, or there is a bug with an element, I can go directly to that element’s style definition and play with all of its properties in one place. Using this method, I would have to jump around between files searching for the right places.

Also, with page loading, what if one stylesheet hangs when its being downloaded. So the user might see a giant red colored eyesore for a while until the next stylesheet jumps in and fixes it. With one stylesheet, it may take a bit longer for the page to completely load, but for the most part each element receives all of its styles at once.

@sander
IE7 ships with Vista. That’s the big problem. Every new computer with Vista = 1 new IE7 user.
If the results of Microsoft’s efforts at pushing out IE7 to IE6 users - as a “critical update”, no less - is any guide, efforts at pushing out IE8 will come nowhere near eradication. We’ll be dealing with IE7 for many years.
BTW, Microsoft publishes a schedule of product lifecycles listing when they will drop support (exclusive of security updates) for different products.
IE6 on Windows XP gets shelved in late Spring 2010.

I’m barely learning C++ and Objective C, would you guys have a recomendation for a book to learn about HTML, XHTML, and CSS? I’ve seen too many and I can’t figure out how to separate the good one from the average ones. Thank you guys.

I always have problems getting conditional statements to work, so I actually use a very lightweight snippet of php code to call seperate stylesheets for IE and firefox. Check it out on my website in the header section. http://www.shockforcestudio.com

As much as I hate when it’s time to apple+tab over to IE6 and 7 from firefox and hit refresh, I must admit that the 2 browsers help to point out a lot of problems with my CSS that sometimes FF/Safari etc. “ignore” and “appear” to render correctly anyway. I find that making small adjustments to my CSS to fix IE6 and 7 issues cause no problems in FF/Safari renders and am embarrassingly grateful that my foes (IE6 and 7) pointed those things out to me. Usually, the fixes make sense too. I very rarely even need to make a separate style for IE6 and 7, thanks especially to standards-compliant ways of invoking has-layout and clearing floats. The last site I made has an IE stylesheet for ONE element, the “behavior” element for PNG support in IE. My continuing inspiration is found in the fact that even the most elite CSS designers today are still abusing CSS because it wasn’t intended to do what we’ve made it do at all. Floating for layout? Although necessary for us now, DIVs were intended to stack one on top of the other. So, in exaggeration, we’re all just hacking our way to the coming days of CSS3 table support, but thank you W3C for current CSS 2.1 spec.

Have a look at a “new book from sitepoint titled Everything You Know About CSS is Wrong”:http://www.sitepoint.com/books/csswrong1/ .

In contrast to the parts of this article you’re dissapointed with, you’ll appreciate “the book’s”:http://www.sitepoint.com/books/csswrong1/ _drive toward the future_ in regards to preparing for new CSS and Browsers and what to do about older browsers, _rather than discussing support for NN5 and IE older than 6_.

the PHP spits out a condensed result of loading those files in turn (vars.php allows me to define global values such as “$ugly_red=’#faa’” and then use those values throughout my other css files. (parameterised CSS is good - should have been in the spec all along)

When production time comes along, I just load that css url into the browser as is, and copy/paste the result into “site.css” and change the value in the link tag of the template to remove the time spent by PHP producing my css.

Best of both worlds: single http request, minified css code, and I get to work on small, reusable, maintainable and understandale CSS

As a bonus I also get to parameterise my CSS when I want to as well.

The (very basic) ‘compiler’ I use is here - “http://pastebin.com/f4ea23657”:http://pastebin.com/f4ea23657

Its probably bug-ridden, and its VITAL that you don’t put such a script onto a public server (it only gets used on the dev server that lives under my desk and isn’t externally routable ...)

In my current position I work on a site that has many dynamic pages. I would find it too timely to maintain the site wide and page specific CSS in this manner (i just prototyped a page to test). This seems as though it is geared for a small / static site.

We load a few different CSS files (I don’t think load times from different CSS files causing multiple requests is a problem), which are usually a global.css, a portal specific CSS file, and then a page specific CSS file. I prefer to have my CSS rules in one place, because this removes the chance that you may have identical mistakes hidden throughout your 2k lines of CSS. Keep it simple, keep it fresh.

Sorry, this is kind of an off topic question. I am using the same kind of browser detector the author used in the article. I have gotten it to work in all version of IE but not Mozilla and Firefox. Is there a browser detector I can use for Mozilla and Firefox similar to the one used in the article that doesn’t require any Javascript? Can anyone help?

I just wanted to say that I really enjoyed the article as well as the discussion that has followed.

I would like to respond to some of the comments with relation to actually having multiple style sheets. I think a good technique or tip, is to create one style sheet when in development of the site. Only after the CSS design is complete should you break it up. I think this process with help designers better structure their markup and make it not as cumbersome as first thought.

Using a CDN to compensate for the additional HTTP requests doesn’t make sense to me.so i want to apply this on the <href=“http://www.justcrapsdice.com”>craps dice</a> site.The network does nothing to reduce the amount of requests. It just adds another DNS look up into the mix and adds cost to the project for no reason. If I’m not mistaken, the point of a CDN is to have the files served from a location closer to the client.Say several pages list forum topics and have a comment box (like a profile page). It makes sense to have a comments.css and a forums.css file. This greatly reduces the amount of CSS I need to write and maintain, with the additional benefit that simpler pages do not need all the CSS overhead that more complex pages do.I agree with Jens Meiert, performance and maintainability needs more digging.I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.

Using a CDN to compensate for the additional HTTP requests doesn’t make sense to me.so i want to apply this on the <href=“http://www.justcrapsdice.com”>craps dice</a> site.The network does nothing to reduce the amount of requests. It just adds another DNS look up into the mix and adds cost to the project for no reason. If I’m not mistaken, the point of a CDN is to have the files served from a location closer to the client.Say several pages list forum topics and have a comment box (like a profile page). It makes sense to have a comments.css and a forums.css file. This greatly reduces the amount of CSS I need to write and maintain, with the additional benefit that simpler pages do not need all the CSS overhead that more complex pages do.I agree with Jens Meiert, performance and maintainability needs more digging.I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.