【发布时间】:2018-11-13 01:47:05
【问题描述】:
我的目标是用 svg 图像中定义的边框来框住整个页面。我认为我的css 应该可以解决问题,但边框无法缩放到浏览器窗口。
我的 .css 文件应该是什么样的?
我应该修改svgviewbox吗?
我的代码:
html {
background: url(img/border.svg) no-repeat fixed;
background-size: cover;
background-size: 100% 100%;
}
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>some text.</p>
<svg viewBox="0 0 300 300" xmlns="http://www.w3.org/2000/svg">
<path d="m0 0.1375h198.7v111.92h-198.7v-111.92m2.3812 1.8521v98.954c0 1.3229 1.0583 2.3812 2.6458 2.3812h191.29l0.26459-98.69c0-1.5875-1.0583-2.6458-2.9104-2.6458z" fill="#d9d9d9"/>
</svg>
</body>
</html>
【问题讨论】:
-
我试过了,还是不行。