HTML 不用图像文件的圆角解决方法
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>不用图像文件的圆角解决方法</title>
<style type="text/css">
ul{
height:26px;
margin:0;
padding:10px;
list-style-type:none;
background:#ddd;
}
.item{
float:left;
width:100px;
margin:0 -1px 0 0;
padding 0;
font: 14px Arial;
font-weight:bold;
}
.item p{
padding:0 0 2px 0;
margin:0px;
text-align:center;
background:#cc6;
border:solid 1px #000;
border-top-width:0;
}
.item div{
height:1px;
overflow:hidden;
background:#cc6;
border-left:solid 1px #000;
border-right:solid 1px #000;
}
.item .row1{
margin:0 5px;
background:#000;
}
.item .row2{
margin:0 3px;
border:0 2px;
}
.item .row3{
margin:0 2px;
}
.item .row4{
margin:0 1px;
height:2px;
}
.item a , .item a:visted{
display:block;
color:#000;
text-decoration:none;
}
.item a:hover{
background:transparent;
}
.item a:hover p{
background:#884;
color:#fff;
}
.item a:hover .row2,
.item a:hover .row3 ,
.item a:hover .row4{
background:#884;
}
</style>
</head>
<body>
<ul>
<li class="item"><a href="#">
<div class="row1"></div> <div class="row2"></div>
<div class="row3"></div> <div class="row4"></div>
<p>首页</p>
</a>
</li>
<li class="item"><a href="#">
<div class="row1"></div> <div class="row2"></div>
<div class="row3"></div> <div class="row4"></div>
<p>导航一</p>
</a>
</li>
<li class="item"><a href="#">
<div class="row1"></div> <div class="row2"></div>
<div class="row3"></div> <div class="row4"></div>
<p>导航二</p>
</a>
</li>
<li class="item"><a href="#">
<div class="row1"></div> <div class="row2"></div>
<div class="row3"></div> <div class="row4"></div>
<p>导航三</p>
</a>
</li>
</ul>
</body>
</html>效果图:
领悟:只是通过row*的类一层一层住下叠,从窄到宽的长度让人看起来像是圆角。也是一种笨的还有些有用处的方法。一直不建议使用。
相关推荐
lupeng 2020-11-14
sjcheck 2020-11-10
nercon 2020-08-09
pythonclass 2020-07-29
玫瑰小妖 2020-07-18
WebVincent 2020-07-09
lyg0 2020-07-05
WebVincent 2020-06-16
huzijia 2020-06-16
qsdnet我想学编程 2020-06-13
pythonclass 2020-06-06
nercon 2020-06-06
gufudhn 2020-06-06
STPace 2020-06-04
HSdiana 2020-06-03
haocxy 2020-05-31
行吟阁 2020-05-30
haocxy 2020-05-28