Cascading Style Sheets

Computers & TechnologyInternet

  • Author Art Daco
  • Published May 16, 2010
  • Word count 734

The cascading style sheets, CSS is a language used to define the presentation of a structured document written in HTML or XML (and by extension XHTML). The W3C (World Wide Web Consortium) is responsible for developing the specification of style sheets that serve as a standard user agents or browsers.

The idea behind the development of CSS is to separate the structure of a document from its presentation.

For example, the HTML element indicates that a block of text is a heading and which is more important than a block labeled . Older versions of HTML allow extra attributes into the open tag to format (such as color or font size). However, each label should have the information if they wanted a consistent design for a page and also a person who read this page in a browser completely lost control over the display of text.

When using CSS, label should not provide information on how it will be viewed, just mark the document structure. Separate style information in a style sheet specifies how it has to show : color, font, text alignment, size and other non-visual features to define the volume of a speech synthesizer (see synthesis of speech) , for example.

Style information can be attached either as a separate document or in the same HTML document. In this case general styles could be defined in the header of the document or in each particular tag using the attribute "style."

CSS provides three different ways to apply style rules to a web page:

  • An external style sheet, which is a style sheet that is stored in a separate file to the file that stores the HTML Web page. This is the most powerful way to program, because it completely separates formatting rules for the HTML page of the basic structure of the page.

  • An internal style sheet, which is a style sheet that is embedded within an HTML document. (He goes right into the element). This will get the benefit of separating the style information, HTML code itself. You can choose to copy the embedded style sheet from one page to another, (this possibility is difficult to implement if you want to keep the copies synchronized.) In general, the only time you use an internal style sheet, is when you want to provide some feature to a Web page in a single file, for example, if you are sending something to the website.

  • An inline style, which is a method to insert the page style language directly within an HTML tag. This approach is not entirely appropriate. The description of the formatting embedded in the Web page document, code-level task becomes a long, tedious and inelegant to solve the problem of scheduling page. This way of working could be used occasionally if they are to apply formatting in a hurry, the flight. It is not as clear, or structured, it should be, but it works.

The advantages of using CSS (or other style language) are:

  • Centralized control of the presentation of a complete website thus significantly speeds up the update.

  • Browsers allow users to specify their own local style sheet that will be applied to a web site, which greatly increases accessibility. For example, visually impaired people can set their own style sheet to increase the size of the text or highlight more links.

  • A page can have different style sheets depending on the device to display or even the user's choice. For example, to be printed, displayed on a mobile device, or be "read" for a synthesized speech.

  • The HTML document itself is clearer to understand and be able to reduce considerably the size (if not use inline style.)

Before CSS was available, the only way to compose a page was spatially using tables. Although it is a convenient and versatile technique is being used an element with a particular semantic, which is to express tabular information only for its effect on the presentation.

The introduction of CSS has led in many cases replace the use of tables. But CSS does not yet provide the versatility offered by the tables, make a diagram of a complex page is often a difficult task in CSS and browser differences even more difficult task. Future developments are expected to resolve this deficiency in CSS3 CSS and make the language more suitable to describe the spatial structure of a page.

More about CSS and HTML you can find on CSS HTML web portal.

Article source: https://articlebiz.com
This article has been viewed 876 times.

Rate article

Article comments

There are no posted comments.

Related articles