HomePage | RecentChanges | Preferences | Newbie Help
Category CSS FAQ
- Why use CSS instead of traditional HTML presentation?
- What are the reasons for using CSS?
- Why should I use CSS?
I use CSS for all my webpages, it lets you establish a look for all your pages without being constrained to those ideas, also.
I have been using CSS for quite some time now, and these are some of the advantages I have found:
- If you use an external stylesheet, you can style all pages at once. For example, if you want a different colour scheme, there is no need to edit every single page; simply change the colours in your stylesheet, and presto!: Instant re-design.
- You can concentrate on the HTML code and the content, and only add style once the page or the whole site is finished.
- Trying out different styles is as easy as commenting/un-commenting sections of your linked stylesheet.
- If your site is well-structured (X)HTML, there is no need for separate print pages: Simply disable stylesheets, and you've got a clean page to print out on a b/w printer. By offering a button that will reload the page without a stylesheet, you can even pretend this is a 'special print' stylesheet ;-).
- Through the use of CSS, the page will automagically adjust itself to your user's screen resolution and viewing preferences. No more browser sniffing necessary.
- The code is much cleaner and leaner, which makes maintenance much easier.
Naturally, there are also a few disadvantages:
- Browser support for some vital CSS features is non-existant. Always make sure to check [Eric Meyer's Masterlist].
- CSS is not just a new design language. It's a new philosophy. Learning CSS is easy, but learning the new philosophy is hard. Most people still use CSS to replicate traditional website design, instead of exploring the new possibilities (and new limitations) of CSS.
- The [Cascade]in CSS is a pain in the ass. You'll never know what weird browser/user settings you might encounter, and therefore you have to make a lot of otherwise redundant declarations. But thanks to the folks who wrote the W3C [CSS checker], you'll get warnings if you don't.
- You are no longer in control of every aspect of presentation (you weren't in control before, but it was easier to pretend...). Any halfways educated user can disable stylesheets and see your site in b/w, or he can even specify a user stylesheet (see [CSS Anarchist's Cookbook]) and completely rip your site apart. Most people use user stylesheets because they have special requirements, and I think this is great because it makes my site more usable for them. But I know that some clients will go berserk when they find out that their valuable CI is so easily wrecked. --Matthias Gutfeldt
I've tried to jot down a few arguments for the use of CSS in the [CSS basics tutorial]. It might be getting a little dated, though. --Stephanie Booth