Grammar:
Cascading style sheets have simple syntax and use some English keywords to specify the names of various style attributes. A style sheet includes a series of rules. Each rule or rule set contains one or more selectors and one declaration block.
Selector Selector
In cascading style sheets, selectors are often used to declare part of a markup style, which is applied to the label style itself through matching tags and attributes. Selectors can be used in:
- All elements of the specified type, for example, the second-level header label H2
- The element specified by the property, especially
ID: A unique identifier in the document
Class: A unique multi-element group in the document.
- In the number of documents, the element depends on the relative position of other elements
Classes and IDs are case-sensitive and begin with a letter, which can contain alphanumeric characters and underscores. Any number of elements of any number of instances can have the same class. In general, an ID is only applied to an instance of an element.
CSS Cascading Style Sheets