:not意为排除某个元素,可以多次叠加使用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Document</title>
<style>
li:not(.head_logo):not(.head_item):hover{
background: red;
}
</style>
</head>
<body>
<ul class="head_ul">
<li class="head_logo">head_logo</li>
<li class="head_item">head_item</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</body>
</html>
原文地址:http://blog.51cto.com/12173069/2109148