在同一份css文件中,如果有两个css对同一个元素起作用,那么文件的最后一个css对元素起作用,比如

#container .center{
margin:0 auto;
padding:0;
width:940px;
}
#header .center{
padding:6px 0;
}

html结构为

<div >
JQuery学习
</h1>

<div class="where right">

<h2>Hello world!</h2>
<span>Please print hello world</span>
</div>
<div class="clear">&nbsp;</div>
</div>
</div>

这两个css类都对center起作用,但是,首先出现的css类会被后面的覆盖。这里#container .center就被#header .center覆盖

相关文章:

  • 2021-07-14
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2021-10-11
  • 2021-11-02
相关资源
相似解决方案