How to write css id selector

藏色散人
Release: 2023-01-03 09:23:46
Original
7122 people have browsed it

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;}
Copy after login

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;}
Copy after login

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:

This is a paragraph of introduction.

Copy after login

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!

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 admin@php.cn
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!