为什么在css中使用空格分隔事物 [英] Why are spaces used to separate things in css

查看:22
本文介绍了为什么在css中使用空格分隔事物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我不理解的 wordpress 样式表中的一些内容:

Here is something in a wordpress stylesheet that I don't understand:

blockquote cite,
blockquote em,
blockquote i {
font-style: normal;
}

blockquote 和 cite 之间的空格有什么作用?我知道如果它们用逗号分隔,那么 blockquote 和 cite 都会有 "font-style: normal;"现在它们用空格分隔,这是否意味着如果将块引用标签嵌入到引用标签中,它将得到font-style: normal;"?

what does the space between blockquote and cite do? I understand if they are separated by a comma, then both blockquote and cite will have "font-style: normal;" now they are separated by space, does this mean if a blockquote tag is embedded into a cite tag it will get "font-style: normal;"?

谢谢.

推荐答案

空间被称为 后代组合器.blockquote cite 选择 blockquote 元素内的任何 cite 元素.blockquote emblockquote i 也是如此.

The space is known as the descendant combinator. blockquote cite selects any cite element within a blockquote element. Likewise for blockquote em and blockquote i.

换句话说,这不是如果将块引用标签嵌入到引用标签中",而是相反(此外,您不能将 blockquotes 放在 cites 放在首位).

In other words, it's not "if a blockquote tag is embedded into a cite tag", it's the other way around (besides, you can't place blockquotes in cites in the first place).

如您所见,逗号将选择器序列分组到同一规则中.

As you note, commas group selector sequences into the same rule.

这篇关于为什么在css中使用空格分隔事物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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