What three parts does a css style sheet consist of?
青灯夜游Original
2022-05-18 17:16:305711browse
The three components of a css style sheet: 1. Selector, used to tell the browser which objects in the page the specified style will act on; 2. Properties, which are set style options provided by CSS, mainly Including font attributes, text attributes, background attributes, layout attributes, etc.; 3. Attribute value is the valid value of the specified attribute, and the attribute and attribute value are separated by ":".
# The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.
Composition of css style sheet
The CSS style sheet includes three parts: selectors, attributes and attribute values. The syntax style is as follows:
选择符{属性:属性值;}
The syntax description is as follows:
Selector (Selector): also known as selector, is a very important concept in CSS, all in HTML Markers are controlled through different CSS selectors. It tells the browser which objects in the page the style will act on. These objects can be a certain tag, all web page objects, specified class or id values, etc. When the browser parses this style, it renders the display effect of the object based on the selector.
Property: It is a set style option provided by CSS, mainly including font attributes, text attributes, background attributes, layout attributes, border attributes, list item attributes, and table attributes. etc. content. Some of these properties are only supported by some browsers, so their use becomes more complicated using CSS properties.
Attribute value (value): The valid value of the specified attribute. Attributes and attribute values are separated by ":". When there are multiple attribute values, use ";" to separate them.
CSS selector Commonly used CSS selectors are tag selector, category selector, inclusion selector, and ID selection. selector, class selector, etc. Use selectors to control different HTML tags to achieve various effects. The three basic selectors are introduced in detail below.
1. Tag selector
HTML page is composed of many tags, such as image tags
The above is the detailed content of What three parts does a css style sheet consist of?. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn