<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
ul>li{
float: left;
/*向左浮动*/
list-style-type: none;
/*列表样式的内容:无*/
padding: 2px 8px;
/*padding:内边距
margin外边距*/
background: purple;
/*背景颜色*/
color: white;
/*字体颜色*/
border-right: solid 1px white;
/*border边框*/
cursor: pointer;
/*cursor 小手*/
}
</style>
<script >
function down(t){
t.style.background="black";
}
function up(t){
t.style.background="purple";
}
</script>
</head>
<body>
<ul>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">首页</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">用户管理</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">购物车</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">订单</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">退出</li>
</ul>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
ul>li{
float: left;
/*向左浮动*/
list-style-type: none;
/*列表样式的内容:无*/
padding: 2px 8px;
/*padding:内边距
margin外边距*/
background: purple;
/*背景颜色*/
color: white;
/*字体颜色*/
border-right: solid 1px white;
/*border边框*/
cursor: pointer;
/*cursor 小手*/
}
</style>
<script >
function down(t){
t.style.background="black";
}
function up(t){
t.style.background="purple";
}
</script>
</head>
<body>
<ul>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">首页</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">用户管理</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">购物车</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">订单</li>
<li οnmοusedοwn="down(this)" οnmοuseup="up(this)">退出</li>
</ul>
</body>
</html>