Get the App
SLTechnology News&Howtos  ›  Development  › 

How to specify a specific style for HTML elements marked with a specific id

Shulou Source: shulou.com Published: 2022-06-01 12:40:46 10月01日 Update

This article mainly introduces how to specify a specific style for the HTML elements marked with a specific id, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Id selector

The id resolver roughly specifies a specific style for HTML elements marked with a particular id.

The id selector is defined by "#".

The above two id determiners, the first may define that the color of the element is red, and the second defines that the color of the element is green:

# red {color:red;} # green {color:green;}

In the above HTML code, the id attribute is represented by the p element of red as red, while the id attribute is represented as green by the p element of green.

This paragraph is blood.

This paragraph is green.

Thank you for reading this article carefully. I hope the article "how to specify a specific style for HTML elements marked with a specific id" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Element article green style attribute paragraph red face selection two code value interest resolution at the same time more friends style knowledge ribbon Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Technology NVidia Redmi MariaDB