Getting started with CSS style
1. Connect to an external style sheet
Add an external style sheet to the HTML web page to use the following format:
tag is placed to the head section of the document.
Where the REF property is used to define the connection between the connection file and the HTML document. Rel = styleSheet Specifies a fixed preferred style. Fixed patterns are always applied when the style sheet is activated. Web pages cannot specify more than one preferred style.
Interactive style by rel = "alternate style" "pointed out. The third tag in the example defines a interactive style, and the user can choose to replace the preferred style sheet.
Note that now browsers generally lack the ability to select interactive style.
Single style can also be given through multiple style sheets
In this example, three style sheets are combined into a "contemporary" style as a preferred style sheet is applied. To combine multiple styles to form a single pattern, you must use the same Title in each style sheet.
Optional type attributes are used to specify media types --Text / CSS is a stacked style sheet - allowing browsers to ignore style table types they do not support
The tag also has an optional Media property that specifies the media or media that the style sheet is accepted. Allowed values
Screen (default), submitted to the computer screen; Print, output to the printer; Projection, submit to the projector; AURAL, speaker; BRAILLE, submit to convex tactile sensation equipment; TTY, electrical typewriter (using fixed font) ; TV, TV; all, all output devices.
An external style sheet is ideal when the style is applied to a lot of web pages. Web producers use an external style sheet to change the appearance of the entire website and only change a file. Similarly, most browsers save an external style sheet in the buffer, so that if the style sheet avoids the delay when the web page is displayed.
2. Embed a style sheet a style sheet can be embedded in the document using the style element:
A style sheet can be embedded in the document using the style element: