Home  >  Article  >  Web Front-end  >  How to write css id selector

How to write css id selector

藏色散人
藏色散人Original
2021-02-19 09:27:177213browse

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 .

How to write css id selector

#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!

Statement:
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