html颜色渐变怎么弄
发布网友
发布时间:2022-04-22 05:10
我来回答
共2个回答
热心网友
时间:2022-05-13 16:34
你看看demo,css上有注释,再结合一下手册
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
* {
margin: 0;
overflow: hidden;
}
i,
em,
strong {
font-style: normal;
}
.sndli em {
display: block;
float: right;
height: 30px;
border-right: 1px dashed #666;
margin: 5px 0 0 0;
}
a {
text-decoration: none;
height: 40px;
width: 150px;
line-height: 40px;
color: #000000;
display: block;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#b8c4cb), to(#3695d5))/*颜色渐变设置*/
}
ul,
li {
margin: 0;
padding: 0;
}
.outli>li {
list-style: none;
float: left;
box-sizing: border-box;
text-align: center;
position: relative;
}
</style>
<body>
<div class="bar">
<ul class="outli">
<li class="sndli">
<a href="javascript:void(0)">1<em></em></a>
</li>
<li class="sndli">
<a href="javascript:void(0)">2<em></em></a>
</li>
<li class="sndli">
<a href="javascript:void(0)">3</a>
</li>
</ul>
</div>
</body>
</html>
热心网友
时间:2022-05-13 17:52
HTML的话,貌似只能用img标签,插入一张渐变图片。或者用CSS3:参考
http://www.runoob.com/css3/css3-gradients.html