即便被标注为 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/shili/s53866.shtml








