What are the four basic selector types in css?

王林
Release: 2020-11-30 16:33:24
Original
14133 people have browsed it

The four basic selector types in css are tag selectors, ID selectors, class selectors and universal selectors. Selectors in CSS are divided into two categories, namely basic selectors and extended selectors.

What are the four basic selector types in css?

The operating environment of this tutorial: Windows 10 system, CSS3, this article is applicable to all brands of computers.

CSS selectors are divided into two categories: basic selectors and extended selectors, of which there are 4 basic selectors.

(Related learning video sharing: css video tutorial)

Basic selector:

1. Tag selector: for a type of tag

2. ID selector: Use

for a specific tag. 3. Class selector: Use

for all the tags you want. 4. Universal selector (wildcard character) ): Applicable to all tags (not recommended)

Tag selector: A complete HTML page is composed of many different tags, and the tag selector determines which tags use the corresponding CSS style.

What are the four basic selector types in css?

id selector: Select elements based on element ID, which is unique. It is marked with a "#" sign in front.

What are the four basic selector types in css?

Category selector: The class selector selects based on the class name. Very similar to id, any tag can carry id attributes and class attributes. But the id attribute can only be referenced once by a specific tag.

What are the four basic selector types in css?

Wildcard *: matches all tags. Not recommended.

What are the four basic selector types in css?

Related recommendations: CSS tutorial

The above is the detailed content of What are the four basic selector types in css?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
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!