欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

决意任意的昆裔元素,而是盼愿放大规模,只决议某个元素的子元素,请应用子元素决定器(Child selector)。

例如,假定您巴望决意只作为 h1 元素子元素的 strong 元素,梗概如许写:

 

h1 > strong {color:red;}

这个划定规矩会把第一个 h1 上面的两个 strong 元素酿成血色,然则第二个 h1 中的 strong 不受影响:

 

<h1>This is <strong>very</strong> <strong>very</strong> important.</h1>
<h1>This is <em>really <strong>very</strong></em> important.</h1>

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css-tool/t51763.shtml