1、如果一个元素使用了多个选择器,则会按照选择器的优先级来给定样式。
2、选择器的优先级依次是: 内联样式 > id选择器 > 类选择器 > 标签选择器 > 通配符选择器
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
#box{
color:red;
}
.dv{
color:blue;
}
div{
color:black;
}
*{
color:green;
}
</style>
</head>
<body>
<div id="box" class="dv" style="color:orange;">我是一个div</div>
</body>
</html>