Css 多个class值

<h1 class="name1 name2">hahah</h1>

  多个css样式值时显示会先解析name1 的值,然后再解析name2 的值,name2 中的属性会覆盖name1中相同的属性,如果不相同的都会显示出来

h1.name1{
	font-family: Georgia, serif;
	text-align: center;
}

h1.name2{
	color: #00ff00;
	font-weight: normal;
}

  显示效果:name1 和 name2 中所有属性都会被使用,如果name2对其改为left 则left会覆盖center

posted @ 2014-12-31 15:59  lcw5945  阅读(313)  评论(0编辑  收藏  举报