CSS technology (Cascading style sheets)

Cascading style sheets ( hereafter simply - styles ) are designed to facilitate the work of Webmasters. 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. They find 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 various parameters for formatting an 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 form: <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 necessary 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 point on the screen
  • Points (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 need to 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.

Built-in tools for creating cascading style sheets of many HTML-editors allow very quickly and conveniently to 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 take a theoretical lesson on those links.