Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the CSS universal selector?

Shulou Source: shulou.com Published: 2022-06-01 04:30:17 10月04日 Update

This article mainly explains "what is the CSS universal selector". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn what the CSS universal selector is.

Id selector: # header {}

Class selector: .header {}

Element selector: div {}

Subselector: ul > li {}

Descendant selector: div p {}

Pseudo-class selector:: hover,: selection, .action,: first-child,: last-child,: first-of-type,: last-of-type,: nth-of-type (n),: nth-of-last-type (n), for example, a:hover {}

Pseudo element selector:: after,: before, etc., for example: li:after

Property selector: input [type= "text"]

Combinatorial selector: Emam Fram E F (descendant selector) / E > F (child element selector) / EquiF (directly adjacent element selector-adjacent sibling elements after matching) / EtalF (ordinary adjacent element selector-sibling elements after matching)

Hierarchical selector: p~ul selects each ul element preceded by a p element

What is the basic syntax of css? the basic syntax of css is:

1. The css rule consists of a selector and one or more declarations.

2. Selectors are usually HTML elements that need to be styled

3. Each declaration consists of an attribute and a value

4. Attributes and attribute values are separated by colons.

Thank you for your reading, the above is the content of "what is the CSS universal selector", after the study of this article, I believe you have a deeper understanding of what the CSS universal selector is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Selection elements attributes learning content siblings descendants grammar common two colons multiple that is levels ideas situations articles more styles knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB macOS Xiaomi Microsoft