‘Style is a simple way of saying complicated things’

IDEA No 44

CASCADING STYLE SHEETS

The French poet Jean Cocteau once said, ‘Style is a simple way of saying complicated things’. He was not talking about Cascading Style Sheets, but he might as well have been.

Cascading Style Sheets allow a document’s style to be influenced by multiple style sheets. One style sheet can inherit or ‘cascade’ from another, permitting a mixture of stylistic preferences.

Cascading Style Sheets (CSS) control presentational elements such as layout, colours and fonts. This was not always the case. In the early days of the Web, each page was assembled by an independent chunk of HTML, and layout options were limited. Fonts and colours could not be manipulated. An email sent to the W3C mailing list in 1994 is revealing: ‘It has been a constant source of delight for me over the past year to get to continually tell hordes (literally) of people who want to -- strap yourselves in, here it comes -- control what their documents look like in ways that would be trivial in TeX, Microsoft Word, and every other common text processing environment: “Sorry, you’re screwed.”’ The author of the message was Marc Andreessen, the creator of the Mosaic browser.

As the Web reached a more mainstream audience, designers started to demand greater control over the appearance of a page. Despite the protestations of people like Andreessen, they got what they wished for. The cost was more complex HTML. It was more difficult to code, labour-intensive to maintain and slow to load.

Style sheets were suggested as the solution. This was not a new idea. When the Web was first conceived, Robert Cailliau saw the need for three types of style sheet: one for editing, one for presentation and one for printing. Style sheets were also consistent with accepted wisdom, that structure should be separated from presentation, an idea first expressed by the father of markup language, William Tunnicliffe.

Two existing style-sheet solutions were combined to form the foundation of what would become CSS. Cascading HTML Style Sheets (CHSS), as used by the Opera browser, and Bert Bos’s Stylesheet Proposal. Opera’s Chief Technology Officer, Håkon Wium Lie, and Bos worked together to create the W3C specification. By the end of 1996 they had completed the task.

It was almost four years before any major Web browser implemented CSS. Under pressure from the Web Standards Project (WaSP), Internet Explorer 5.0 – released in March 2000 – was almost fully CSS compliant. By the end of 2001, Netscape Navigator had followed suit.

CSS reinvented web design. Sites that use style sheets are easier to build and maintain. The more compact code is faster to load and easier for search engines to index. Finally, CSS ensure consistency across navigation and design, making for a better user experience.

Style is substance, after all.

‘Sites that use style sheets are easier to build, faster to load and ensure consistency across navigation and design’

Håkon Wium Lie, Opera’s Chief Technology Officer and co-creator of the CSS standard.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.162.247