What is the grammatical structure of css?
May 18, 2019 am 11:13 AMThe grammatical structure of CSS only consists of three parts: selector (Selector), attribute (property), and value (value).
Usage syntax:
selector {Property:value;}
The selector (Selector) refers to the object to be targeted by this set of style coding. It can be an XHTML tag, such as body, h1; it can also define a specific ID Or the CLASS tag, such as the #main selector, which means selecting <div id="main">, that is, an object with main as the id specified. The browser will strictly parse the CSS selectors, and each set of styles will be applied to the corresponding object by the browser.
Property is the core of CSS style control. For each tag in XHTML, CSS provides rich style attributes, such as color, size, positioning, floating method, etc.
Value (value) refers to the value of the attribute. There are two forms. One is the value of the specified range, such as the float attribute. Only three values of left, right, and none can be applied, such as width. It can be specified using 0-9999, or other mathematical units.
In practical applications, we often use the following similar application forms:
body {background-color:blue;}
Explanation:
The body{} above is a type selector. The so-called type selector refers to the selector that uses the existing tag type in the web page as its name. Body is a tag type in the web page, so is div, and so is span. Therefore, the following selectors are all type selectors, and they will control all bodies, divs, or spans in the page:
body{} div{} span{}
The above is the detailed content of What is the grammatical structure of css?. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What language is the browser plug-in written in?
