【发布时间】:2011-11-06 23:03:24
【问题描述】:
我最近在设计网页时遇到了问题。我需要有圆角和渐变背景。对于 IE6-8、Firefox 和 Chrome,我使用 CSS3Pie 解决了它。由于 Pie 在 IE 9 上不起作用,我想出了SVG gradients。当我在本地机器上测试时,没有问题。一切还好。但是当我粘贴到我的 VS2010 Proyect 上时,什么也没发生,因为没有找到 .svg。从未达到?还是VS2010的问题?。这是我的代码:
default.aspx
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Sample</title>
<style type="text/css" media="screen">
.svgWorkPlease
{
border-radius: 100px;
box-shadow: 0px 2px 4px #999;
margin:20px;
height:500px;
width:500px;
background-repeat: repeat-x;
background-position-x: 0px;
background-position-y: 100%;
filter:none;
background-image: url(gradients.svg);
background-size: 100% 200%;
}
</style>
</head>
<body>
<div class="svgWorkPlease">Hmmmmm....</div>
</body>
</html>
渐变.svg
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" />
<stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" />
</linearGradient>
<linearGradient id="grad2" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:rgb(0,255,255);stop-opacity:1" />
<stop offset="100%" style="stop-color:rgb(0,0,255);stop-opacity:1" />
</linearGradient>
</defs>
<rect x="0" y="0" width="100" height="100" style="fill:url(#grad1)" />
<rect x="0" y="100" width="100" height="100" style="fill:url(#grad2)" />
</svg>
提前致谢!
【问题讨论】:
标签: asp.net css visual-studio-2010 internet-explorer svg