一个决定器,多种用法
即使被标注为 sidebar 的元素只能在文档中呈现一次,这个 id 决议器作为派生决意器也大要被应用很频仍:
#sidebar p { font-style: italic; text-align: right; margin-top: 0.5em; } #sidebar h2 { font-size: 1em; font-weight: normal; font-style: italic; margin: 0; line-height: 1.5; text-align: right; }
在这里,和页面中的其余 p 元素显然差距的是,sidebar 内的 p 元素获取了非凡的措置,同时,和页面中其他悉数 h2 元素明显差异的是,sidebar 中的 h2 元素也获得了一致的非凡处置。
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/rumen/r52398.shtml