Pages

Tuesday 30 October 2012

Style Sheet



Cascading Style Sheet :

The CSS allows to seperate out two issues of the web document and those are  the information contents and presentation. Following are some useful features of the cascading style sheets.

1. CSS allows seperation between the information contained in a document and its presentation. Hence any change in the presentation can be made without disturbing the information of the document.
2. Style sheets allows user to decide the style of presentation. This presentation style can be defined in a seperate file. Thus the presentation can be made persistent.
3. CSS allows the developer to give the consistent appearence to all the elements of the web page. For instance: if you want that the element h1 must be displayed in red font, then all the text displayed using h1 tag will be red in color.
4. If we use single style sheet for all the pages of the web site then all the pages will have a consistent look and feel.
5. CSS provides precise control over font size, color, background color and so on.

Embedded Style Sheet :
This type of style sheet appears only in the head section and in the body section. Newly defined Selector tags are used with the actual contents.

External Style Sheet :
Sometimes we need to apply particular style to more than one web documents in such cases external style sheets can be used. The central idea in this type of style sheet is that the desired style is stored in one CSS file. And the name of that file has to be mentioned in our web pages. Then the styles defined in CSS file will be applied to all these web pages. Here is a sample program in which external style sheet is used.

No comments:

Post a Comment