CSS上的选择器分组和上下文选择器示例 [英] Example of Selector grouping and Contextual Selector on CSS

查看:248
本文介绍了CSS上的选择器分组和上下文选择器示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我明天要参加考试,我想了解

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 all around google with many sources it starts to make me confuse because when I answer this on my previous test I got the answer wrong when I used the answer that I found from the internet, but the one below is the correct answer from our professor.

a. Selector grouping example 

   td, th, li { property: value; }

b. Contextual Selector example 

   table p { property: value; }   

任何人都可以给我一些更多的信息选择器分组和上下文选择器意味着什么更多的例子

Can anyone please give me some more information what does selector grouping and contextual selector mean with some more example please.

推荐答案

基本上你看的是以下内容。

Basically what you looking at is the following.

for

a. Selector grouping example 

   td, th, li { property: value; }

上面的说法是你想为$ b的同一个属性赋予相同的值$ b all td,th和li

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; } 

这一个说你想设置属于< table> 标签

这篇关于CSS上的选择器分组和上下文选择器示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆