CSS grouping and nested selectors

CSS Grouped and Nested Selectors


##Grouped Selectors

There are many elements with the same style in the style sheet,

In order to minimize the code, you can use grouping selectors.Separate each selector with a comma.

Example

    php中文网(php.cn)  

PHP中文网你

php.cn

学习PHP知识的好选择.

Run the program and try it


Nested selectors

It may apply to the styling of selectors inside selectors .

In the following example, three styles are set:

Specify a style for all p elements, specify a style for all class="marked" elements, and specify a style for all class="marked" elements. The p element specifies a style

    php中文网(php.cn)  

褪尽风华,我依然在彼岸守护你

那些繁华哀伤终成过往,

请不要失望,平凡是为了最美的荡气回肠。

Run the program to try it



##

Continuing Learning
||
php中文网(php.cn)

PHP中文网

php.cn

你学习PHP知识的好选择.

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!