<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
li a:hover {
background-color:#000;
display: block;
}
#text a:hover{
background-color:#ff0000;
display:inline;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>改变li的背景色</title>
</head>
<body>
<div>
<ul>
<li><a href="#">整个li的背景色都变了</a></li>
<li id="text"><a href="#">只有文字的背景都变了</a></li>
</ul>
</div>
</body>
</html>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!