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

被标注为 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/css-tool/t53742.shtml