div圆角和颜色渐变的设置

时间:2023-03-09 08:00:24
div圆角和颜色渐变的设置
 <!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">
<!--
#div1
{
width:300px;
height:200px;
border:#ad0000 1px solid;
background-color:#39F;
}
#div1
{
-ms-border-radius:8px;
-moz-border-radius:8px;
-webkit-border-radius:8px;
-khtml-border-radius:8px;
-o-border-radius:8px;
border-radius:8px;
}
#div2
{
width:300px;
height:200px;
border:#ad0000 1px solid;
}
#div2
{
/*设置过渡效果*/
background-image:-moz-linear-gradient(top,#accff7,#4d94f4); /*用于火狐浏览器*/
background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#accff7),color-stop(1,#4d94f4)); /*用于Safari和Chrome浏览器*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#accff7',endColorstr='#4d94f4',GradientType='0'); /*用于IE6 & IE7浏览器*/
background: -ms-linear-gradient(top,#accff7,#4d94f4); /* CSS3 针对IE的写法。主要是IE10以前的版本不支持css3,所以对IE要写两个语句*/
}
-->
</style>
</head> <body>
<div id="div1"> </div>
<br />
<div id="div2"></div>
</body>
</html>