Home > Article > Web Front-end > How to write css id selector
css The writing method of id selector is "#selector{property:value}". There is a # sign in front of the ID selector, also known as the checkerboard number or pound sign; like the class selector, the ID selector Wildcard selectors can be ignored in .
#The operating environment of this tutorial: Windows 7 system, Dell G3 computer, CSS3 version.
How to write css id selector?
How to write css id selector: #selector{property: value}
.
In some ways, ID selectors are similar to class selectors, but there are some important differences.
Syntax
ID selectors are preceded by a # sign - also known as a checkerboard number or pound sign. (Related course recommendations: css video tutorial)
Please see the following rules:
*#intro {font-weight:bold;}
Like the class selector, the wildcard selector can be ignored in the ID selector . The previous example could also be written as:
#intro {font-weight:bold;}
The effect of this selector would be the same.
The ID selector refers to the value in the id attribute. Here's an example of an actual ID selector:
<p id="intro">This is a paragraph of introduction.</p>
The above is the detailed content of How to write css id selector. For more information, please follow other related articles on the PHP Chinese website!