CSS3中新性样式
css选择符(selector)
css选择符(selector)是一种模式,类似于正则表达式,是用来匹配html或者xml文档中各种元素的css规则的一部分,紧跟在选择符后{}括号内的声明代码将会应用到所有能匹配这个模式的元素,除非它被cascade的规则覆盖了。css选择符可以分为以下几种。
全局选择符(universal selector)
全局选择符可以匹配任何的html元素,不过它有一个规则就是:不匹配零个或者同时多个元素,举个例子,以下的全局选择符
div * em
将会是以下的结果:
“Universal” in the h1 元素 (* 匹配 the
“emphasize” in the p 元素 (* 匹配 the
)
“not” in the first li 元素 (* 匹配 the
- 或者 the li)
“type” in the second li 元素 * 匹配 the
- 或者 the li
没有”immediate</em”,因为在
和
之间没有元素被*匹配。