3Style Sheets: CSS3

Style Sheets: CSS3

CSS – Cascading Style Sheets – is commonly used to format HTML-type web pages using display properties (colors, fonts, borders, etc.) and positioning properties (height, width, top-down, side-by-side, etc.). The display result of a web page can be completely changed without adding additional code to the web page. Indeed, the main purpose of style sheets is to separate the content of the page from its visual appearance. This approach makes it possible to:

  • – avoid repeating the same formatting code in each web page;
  • – employ common styles, using clear names (e.g. employing the same shaded style for images or text);
  • – modify the appearance of an entire website by changing only one single file (the style sheet);
  • – understand the code of the web page.

It should be noted that CSS is part of the standards published by W3C (World Wide Web Consortium).

3.1. Overview

3.1.1. Origins of CSS3

3.1.1.1. CSS1: arduous adaptations in the battle of the browsers

The final specification of CSS1 was revealed on December 17, 1996, presenting 50 properties. The W3C definition of CSS1 is a “simple style sheet mechanism that allows authors and readers to attach styles to the HTML document”1. In order to facilitate the task for web developers, CSS1 is a language that can be easily read and written immediately by its human users, and it features a lexicon consistent with common uses in computer publishing.

3.1.1.2. CSS2: hasty ambitions

CSS was assigned ...

Get Website Design and Development with HTML5 and CSS3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.