Difference between revisions of "Cascading Style Sheets"

From Christoph's Personal Wiki
Jump to: navigation, search
(Started article)
 
(+cat)
Line 87: Line 87:
 
*[http://www.ilovejackdaniels.com/css/box-model/ CSS Box Model] - A guide to the box model in CSS and how different browsers treat it.
 
*[http://www.ilovejackdaniels.com/css/box-model/ CSS Box Model] - A guide to the box model in CSS and how different browsers treat it.
 
*[http://www.redmelon.net/tstme/box_model/ Interactive CSS Box Model Demo]
 
*[http://www.redmelon.net/tstme/box_model/ Interactive CSS Box Model Demo]
 +
 +
[[Category:Technical and Specialized Skills]]

Revision as of 22:40, 14 December 2005

In computing, Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can be applied to any kind of XML document, including SVG and XUL. The CSS specifications are maintained by the World Wide Web Consortium (W3C).

Overview

CSS is used by both the authors and readers of web pages to define colors, fonts, layout, and other aspects of document presentation. It is designed primarily to enable the separation of document structure (written in HTML or a similar markup language) from document presentation (written in CSS). This separation can improve content accessibility, provide more flexibility and control in the specification of presentational characteristics, and reduce complexity and repetition in the structural content. 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. Similarly, identical HTML or XML markup can be displayed in different 'brands', liveries or colour schemes on different but related web sites referencing different CSS.

Recommendations

The first CSS specification to become an official W3C Recommendation is CSS level 1, published in December 1996. Among its capabilities are support for:

  • Font properties such as typeface and emphasis
  • Color of text, backgrounds, and other elements
  • Text attributes such as spacing between words, letters, and lines of text
  • Alignment of text, images, tables and other elements
  • Margin, border, padding, and positioning for most elements
  • Unique identification and generic classification of groups of attributes

The W3C maintains the CSS1 Recommendation.

CSS level 2 was developed by the W3C and published as a Recommendation in May 1998. A superset of CSS1, CSS2 includes a number of new capabilities, among them the absolute, relative, and fixed positioning of elements, the concept of media types, support for aural style sheets and bidirectional text, and new font properties such as shadows. The W3C maintains the CSS2 Recommendation.

CSS level 2 revision 1 or CSS 2.1 fixes errors in CSS2, removes poorly-supported features and adds already-implemented browser extensions to the specification. While it was a Candidate Recommendation for several months, on 15 June 2005 it was reverted to a working draft for further review.

CSS level 3 is currently under development. The W3C maintains a CSS3 progress report.

CSS experiments

Recently, there has been a trend among web designers to document all their experiments with CSS on a section of their site. Examples include:

These experiments are usually only compatible with browsers that are largely standards compliant.

References

See also

  • W3C
  • List of stylesheet languages
  • Comparison of layout engines (CSS)
  • CSS Zen Garden

CSS books

CSS discussions

External links

Tutorials

Demonstrations

Resources

Validation

Reference

  • CSS crib sheet - A quick reference "cheat" sheet.
  • CSS Cheat Sheet - A printable single-page quick reference for CSS.
  • CSS News - Repository of latest tips and tricks in the world of CSS Design.

Browser issues

About the box model