css link顺序与类选择器组合之间的关系

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css order</title>
<link rel="stylesheet" type="text/css" href="../style/base.css" media="all">
<link rel="stylesheet" type="text/css" href="../style/index.css" media="all">
<link rel="stylesheet" type="text/css" href="../style/slider.css" media="all">
<!--
<link rel="stylesheet" type="text/css" href="../style/index.css" media="all">
-->
<style>
.wrapper
{
width
: 790px;
height
: 180px;
margin
: 0 auto;
background-color
:#eee;
padding
:20px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="ui-box module-slider">
<div class="ui-box-container">
css order
</div>
</div>
</div>
</body>
</html>

 

index.css文件:

.module-slider {
border
: 0 none;
}

/*
.ui-box{
border: 1px solid #CCCCCC;
}

*/

 

slider.css文件:

.module-slider {
border
: 0 none;
}

 

其实想说的是<div class="ui-box module-slider">的最终样式与ui-box module-slider的书写顺序没有关系,之前写法与<div class="module-slider ui-box">,影响这个最终样式为link文件加载顺序。




posted @ 2011-11-14 18:03  wkylin  阅读(721)  评论(0编辑  收藏  举报