代码附上:
<title>自适应的斜角水平菜单实例</title>
<style type="text/css">
ul{
font-size:14px;
font-family:宋体
list-style-type:none;/*取消列表样式*/
text-align:center;
}
li{
float:left;
width:80px;
margin:0;
list-style-type:none;
}
li a:link,li a:visited{
display:block;
background-color:#C00;
color:#FFF;
float:left;
width:80px;
position:relative;
text-decoration:none;
padding:6px;
margin:1px 0 0 1px;
}
li a:hover{
background-color:#F90;
color:#333;
}
li a span{
height:0;
width:0;
border-bottom:solid 6px #C00;
border-left:solid 6px #FFF;
position:absolute;
top:0;
left:0;
overflow:hidden;
}
li a:hover span{
border-bottom:solid 6px #F90;
}
</style>
</head>
<body>
<ul id="menu">
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
</ul>
</body>
</html>
<title>自适应的斜角水平菜单实例</title>
<style type="text/css">
ul{
font-size:14px;
font-family:宋体
list-style-type:none;/*取消列表样式*/
text-align:center;
}
li{
float:left;
width:80px;
margin:0;
list-style-type:none;
}
li a:link,li a:visited{
display:block;
background-color:#C00;
color:#FFF;
float:left;
width:80px;
position:relative;
text-decoration:none;
padding:6px;
margin:1px 0 0 1px;
}
li a:hover{
background-color:#F90;
color:#333;
}
li a span{
height:0;
width:0;
border-bottom:solid 6px #C00;
border-left:solid 6px #FFF;
position:absolute;
top:0;
left:0;
overflow:hidden;
}
li a:hover span{
border-bottom:solid 6px #F90;
}
</style>
</head>
<body>
<ul id="menu">
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
<li><a href="#">
<span></span>首页<a/></li>
</ul>
</body>
</html>