Get the App
SLTechnology News&Howtos  ›  Development  › 

How css uses the element Selector

Shulou Source: shulou.com Published: 2022-06-01 03:32:09 09月22日 Update

This article mainly shows you "css how to use the element selector", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "css how to use the element selector" this article.

Element selector

Tag selector refers to using the HTML tag name as the selector, classifying according to the tag name, and specifying a unified CSS style for a certain type of tag in the page. The basic syntax format is as follows:

Tag name {attribute 1: attribute value 1; attribute 2: attribute value 2; attribute 3: attribute value 3;}

In this syntax, all HTML tag names can be used as tag selectors, such as body, H2, p, strong, and so on. The style defined with the tag selector is valid for all tags of that type on the page

For example:

H2 {color: # F00; font-size: 50px;} hyperlink Little Grey No.1 Little Grey No.2 Little Grey No.3

The biggest advantage of tag selector is that it can quickly unify the style for the same type of tags on the page, but this is also its disadvantage, it can not design differentiated styles.

These are all the contents of the article "how css uses element selectors". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Tags selections attributes elements styles content articles pages names types grammar learning help unification maximum effective advantages and at the same time capital differences Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Docker Huawei macOS Shulou Technology