Example of Selector grouping and Contextual Selector on CSS

后端 未结 2 836
有刺的猬
有刺的猬 2020-12-21 18:52

I\'m going to have an exam tomorrow and I\'m trying to understand the meaning and the answer of

Selector grouping and Contextual Selector

While I searched

2条回答
  •  误落风尘
    2020-12-21 19:04

    Basically what you looking at is the following.

    for

    a. Selector grouping example 
    
       td, th, li { property: value; }
    

    what the above is saying that you want to have the same value for the same property for all td,th, and li

    b. Contextual Selector example 
    
       table p { property: value; } 
    

    this one is saying that you want to set the value for

    tags that belongs to

    tags

    so whenever you have a

    in a

    , then it will get effected.

    提交回复
    热议问题