Top: Computers: Internet: Programming: Languages: HTML: CSS




[ history ]

Cascading Style Sheets is a stylesheet format used to describe the presentation of a document written in a markup language like HTML.


[ history ]

History of CSS

CSS were integrated in web browsers since 1970. Each (simple) web browser had their own style language which could be used to customize the appearance of web documents.


[ history ]

CSS usage

Main CSS role is to allow the separation of presentation and structure. A HTML document without CSS must contain all designing information related to color and shape into the HTML code. This make HTML documents larger. Syntax:

Selector {declarations}
Each declaration is followed by,

Property: value
HI {font: Arial}


[ history ]

Embedding a style sheet

The STYLE tag is used to embed style information within a document. The STYLE tag should always include the TYPE declaration, which occurs inside the HEAD tag of the document.


[ history ]

Embedding a style sheet

The STYLE tag is used to embed style information within a document. The STYLE tag should always include the TYPE declaration, which occurs inside the HEAD tag of the document.


[ history ]

Class selector

The BODY of the HTML document can contain elements which may have a class associated with it. These classes enable the user to apply styles to specific parts of the document like font family, background color and so on.


[ history ]

ID as selector

The ID Selector is used in the same way as the class element. The only difference is that the ID attribute has a unique value over the document. The ID name declaration should be preceded by a #, in the STYLE declaration.


[ history ]

Understanding stylesheets

Stylesheets work alongside HTML to define what a web page looks like. The HTML marks up the document structurally—indicating what bits of content are headlines, body text, lists, etc., while the stylesheets describe how the headlines and other elements should look in the web browser.

If you've worked with a page-layout program (like PageMaker or QuarkXpress), you're probably familiar with stylesheets. They allow you to specify how particular types of words—headlines, for example—should appear throughout a document.



 All text is available under the terms of the GNU Free Documentation License. (See Copyright Policy for details.) 
© Open-Site Foundation, Inc.
Hosted by Android Technologies, Inc. the medical robotics news source.
Visit our sister sites dmoz.org | mozilla.org | chefmoz.org | musicmoz.org