What are the grammatical rules of css

藏色散人
Release: 2023-01-04 09:37:08
Original
8097 people have browsed it

The syntax rule of css is "selector and one or more declarations". The style declaration is such as "@charset "utf-8";". The declaration statement starts with @, followed by the identifier. , and end with a semicolon.

What are the grammatical rules of css

The operating environment of this article: windows7 system, Dell G3 computer, HTML5&&CSS3.

What are the grammatical rules of css?

1. CSS rules consist of two main parts: selectors, and one or more statements:

选择器{
    声明1;
    声明2;
    声明3;
    ......
}
Copy after login

What are the grammatical rules of css

2. CSS Style declaration——At-rule

For example: @charset "utf-8";

The style declaration starts with @, followed by the identifier (charset), and finally with a semicolon ( ;)end.

Several at-rules

@charset—defines the character set used by the style sheet

@import—tells the CSS engine to include external CSS style sheets

@namespace - Tells the CSS engine that all content must consider using the XML namespace prefix

Nested at-rules

@media - Conditional group rules. Use this media if the device meets the conditions defined by the standard

@font-face - Describes a font that will be downloaded externally

@keyframes - Describes the intermediate steps in CSS animation The sequence

@page - describes the layout changes to the file when the document is to be printed.

@supports——Conditional group rules, if the browser meets the given rules, apply it to the content

@document——Conditional group rules, if it is used in the document CSS style sheets that meet the given criteria will be applied to all content.

Recommended: "css video tutorial"

The above is the detailed content of What are the grammatical rules of css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this 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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!