Maintained by the World Wide Web Consortium (W3C) Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics — the look and feel, or formatting — of a document written in a markup language, most commonly HTML. The most common application of CSS is to style web pages written in HTML and XHTML, but the language can also be applied to any other kind of XML document.
CSS is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation, including elements such as the page layout or organization, colors, and fonts.
This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content. CSS allows the break-away from many poor practices developed over the years due to lack of certain features in HTML, and for tableless web design through the correct use of division tages (<div>).
CSS can also allow the same markup page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice (when read out by a speech-based browser or screen reader) and on Braille-based, tactile devices. While the author of a document typically links that document to a CSS style sheet, readers can use a different style sheet, perhaps one on their own computer, to override the one the author has specified.
CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element. In this so-called cascade, priorities or weights are calculated and assigned to rules, so that the results are predictable.
CSS is handled through three mechanisms:
Linked provides for one or more style sheets that are common across the pages of the website. These sheets are invoked by using a link element in the HEAD section of the web page. The advantage of this format is that the style sheet has only to be edited once for the effect to be rendered immediately across all linked pages.
Embedded places the actual style sheet code into the HEAD section of the web page. This makes it easy to access while editing the page code itself but changes must be made in each affected web page for the total effect of a change to be rendered.
In-Line provides for the placing of the style attribute directly into HTML tags (elements) to affect change on the element content itself. This makes a minor change quick and easy but makes for difficult on-going style management.
Each mechanism has its purpose, and its following, and no single mechanism is more right than any other.