Get the App
SLTechnology News&Howtos  ›  Development  › 

How css sets all p elements to bold

Shulou Source: shulou.com Published: 2022-06-01 06:53:22 11月12日 Update

This article mainly shows you "how css sets all p elements to bold". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how css sets all p elements to bold".

The first rule sets all p elements that are the first child of an element to bold. The second rule capitalizes all li elements of the first child of an element (in HTML, this must be the ol or ul element).

Please visit the link to see the effect of this: first-child instance.

Tip: the most common mistake is to assume that selectors such as p:first-child will select the first child of the p element.

Note: must be declared so that first-child can take effect in IE.

To give you a better understanding of first-child pseudo-classes, we provide three additional examples:

Example 1-match the first

element

In the following example, the selector matches the p element that is the first child of any element:

P:first-child {color: red;}

Some text

Some text

This is all the content of the article "how css sets all p elements to bold". 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: Elements size examples content articles selection rules learning help thorough uppercase examples common effects easy to understand more organization comments knowledge editing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei Shulou Technology Docker Microsoft