oblaat

a guide to conceiving, creating & publishing your own website

Stylesheets are completely modular

This is something that very few individuals consider when creating personal websites, so now I am considering it for you: one HTML document may request as many different stylesheets as desired. This means that a website can mix and match several different rules easily, given they are split up accordingly.

One website might use one stylesheet for its basic visual identity, like the palette and fonts and text alignment, and another stylesheet for the layout, with background images and the way the sidebar looks and more complicated tricks. On different sections of the website, the layout file might be changed to more appropriately suit the content and give a sub-section its own distinct visual identity while keeping it cohesive with the rest of the site.

The website's maintainer decides to change the colour scheme of the website, so they change the basic CSS file, and the entire website's colours are fixed without having to modify each layout ruleset separately. Or maybe a few pages should have a themed colour scheme and fonts while using the same layout as the site's main pages, so the basic file is replaced while keeping the layout the same.

  1. The website's designer can ensure a consistent identity across the entire website without forgetting to change just one file, and
  2. The website's designer does not have to repeat standard "default" styling between stylesheets created for different layouts, and
  3. More intricate code becomes better organised between files and easier to look through, and
  4. Repeated stylesheets are still stored by the browser to reduce data transfer and load time for the user, so
  5. Maintenance becomes light work!