IT Computer Training Articles Tutorials - Submit Your Article - Articles Submission Directory. - http://www.articles.webtechvision.com
What Is CSS ? Understanding CSS
http://www.articles.webtechvision.com/articles/191/1/What-Is-CSS--Understanding-CSS/Page1.html
Jhon Mark
 
By Jhon Mark
Published on 06/13/2007
 

Cascading Style Sheets (CSS) is a language that works with HTML documents to define the way content is presented. The presentation is specified with styles that are placed directly into HTML elements, the head of the HTML document, or separate style sheets.

Style sheets contain a number of CSS rules. Each rule selects elements in an HTML document. These rules then define how the elements will be styled.

Any number of HTML files can be linked to a single CSS file.


What Is CSS ? Understanding CSS

What Is CSS?

Cascading Style Sheets (CSS) is a language that works with HTML documents to define the way content is presented. The presentation is specified with styles that are placed directly into HTML elements, the head of the HTML document, or separate style sheets.

Style sheets contain a number of CSS rules. Each rule selects elements in an HTML document. These rules then define how the elements will be styled.

Any number of HTML files can be linked to a single CSS file.

What Does Cascading Mean?

There are three types of style sheets that can influence the presentation of an HTML document in a browser. These are

  • Browser style sheets Browsers apply style sheets to all web documents. Although these style sheets vary from browser to browser, they all have common characteristics, including black text, blue links, and purple visited links. These are referred to as default browser style sheets.

  • User style sheets A user is anyone who looks at your website. Most modern browsers allow users to set their own style sheets within their browser. These style sheets will override the browser's default style sheetsfor that user only.

  • Author style sheets The author is the person who develops the websiteyou! As soon as you apply a basic style sheet to a page, you have added an author style sheet. Author styles generally override user styles, which override browser styles.


Cascading means

Cascading means that styles can fall (or cascade) from one style sheet to another. The cascade is used to determine which rules will take precedence and be applied to a document.

For example, rules in author style sheets will generally take precedence over rules in user style sheets. Rules in user and author style sheets will take precedence over rules in the browser's default style sheet.

Where Does CSS Come From?

CSS is a recommendation of the World Wide Web Consortium (W3C). The W3C is an industry consortium of web stakeholders including universities; companies such as Microsoft, Netscape, and Macromedia; and experts in web-related fields.

One of the W3C's roles is to produce recommendations for a range of aspects of the Web. CSS1 became a recommendation in late 1996, CSS2 became a recommendation in May 1998, and CSS2.1 became a recommendation in January 2003.


Why Use CSS ?

Some of the benefits of using CSS for authors include

  • Easy to maintain The power of CSS is that a single CSS file can be used to control the appearance of multiple HTML documents. Changing the appearance of an entire site can be done by editing one CSS file rather than multiple HTML documents.

  • Smaller file sizes CSS allows authors to remove all presentation from HTML documents, including layout tables, spacer images, decorative images, fonts, colors, widths, heights, and background images. Presentation can then be controlled by CSS files. This can dramatically reduce the file sizes of HTML documents.

  • Increased accessibility CSS, combined with well-structured HTML documents, can aid devices such as screen readers. With presentational markup removed, the only thing that a screen reader encounters is structural content. CSS also can be used to increase the clickable area of links, as well as control line height and text line lengths for users with motor skill or cognitive difficulties.

  • Different media CSS can be styled specifically for different media, including browsers, printers, handheld devices, and projectorswithout changing the content or document structure in any way.

  • More control over typography CSS allows authors to control the presentation of content with properties such as capitalize, uppercase, lowercase, text-decoration, letter-spacing, word-spacing, text-indent, and line-height. CSS can also be used to add margins, borders, padding, background color, and background images to any HTML element.

    Summary

    In this lesson, you learned about Cascading Style Sheets and why you should use them. You also learned where style sheets come from and the three types of style sheets that can affect a web page.