This page has been robot translated, sorry for typos if any. Original content here.

CSS Technology (Cascading Style Sheets)

Cascading style sheets (hereafter simply - styles ) are designed to facilitate the work of Web masters. For example, when creating a site from multiple pages, you want the formatting of the page elements to follow a certain pattern, which would not force you to enter long values ​​of the attributes in the code of each page. Such a pattern is the style. The general principle of writing them is as follows:

property_style1: value; property_of_style2: value; ....... property_styleN: value,

where the remaining punctuation marks are applied depending on the style properties.

The properties of the styles are divided into three groups.

  1. Find an application when you need to format an element that does not repeat anywhere else on the page and is related to a specific tag. This style is described as follows: <TAG attribute1 = "value" ...... attributeN = "value" STYLE = "property_style1: value ... property_styleN: value">
  2. Used to describe how to format page elements globally with a name for each style. This description is placed directly in the page code - in the <HEAD> container using the <STYLE> container. Here is an example: <HEAD> <STYLE type = text / css > .style_name { TD_style }. style_name { style_name } </ STYLE> </ HEAD> , where "type = text / css" is required information, and TD is the tag designation to which the style will be applied. Under the words " style_description " it is necessary to understand the various formatting parameters of the element, which can be many.
  3. Used when applying styles in large quantities or when there are more than ten pages, representing a separate text file with the extension. Css . A link to such a file is specified in the <HEAD> container and has the following appearance: <LINK HREF = " stylefile address / filename .css" TYPE = "text / css" REL = "stylesheet">, where TYPE and REL are attributes defining the type file. By the way, you can also refer to another: @import url (" stylefile address / filename. Css").

After we specify the styles in the page or make a link to them - you can apply them with the direct participation of the attributes <CLASS> or <ID> on the desired tags. Example :

<TD CLASS = " style_name "> item_page </ TD> .

There are also two other ways to apply styles - the description of pseudo-classes and pseudo-elements.

The units of measurement in CSS are denoted in:

  • pixels (px) - the minimum dot on the screen
  • paragraphs (pt) is a font unit (1 point = 1/72 in.
  • peaks (pc) - 1 peak is equal to 12 points
  • percent (%) - ratio to another value
  • millimeters (mm) and centimeters (cm) - no comment
  • inches (in) - 1 inch is equal to 2.52 cm

In styles, as in all HTML languages, the RGB model is used when describing the color.

In the HTML 4.01 specification of this language, cascading style sheets should be used everywhere , where they can be used. The international W3C consortium that approved this specification recommends the use of CSS (Cascading Style Sheets). Other methods are marked in it as undesirable.

The built-in tools for creating cascading style sheets of many HTML-editors allow you to quickly and easily cope with this task. However, not having sufficient knowledge in this direction - the result will be the opposite.

Among the wide choice of HTML-editors in which there is an opportunity to create cascading style sheets it is necessary to single out simple and understandable ones - Macromedia HomeSite 5.0 with its Top Style and Macromedia Dreamweaver MX 2004. The latter will be better for beginners.

Before moving on to the editors, we strongly recommend that you pass theoretical lessons on those links.