【发布时间】:2013-09-13 23:00:44
【问题描述】:
我是拉斐尔的新手。我在 div 中写了 svg 标签。请查看此示例http://jsfiddle.net/dhana36/bvs6P/1/
使用 CTRL+ 和 CTRL- 你会发现区别的。
HTML:
<div class="outer">
<svg height="640" version="1.1" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100% 640" preserveAspectRatio="xMinYMin" style="overflow: hidden; position: relative; left: -0.625px;" class="stretchBar">
<desc style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
Created with Raphaël 2.1.0
</desc><defs style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></defs>
<path fill="none" stroke="#000000" d="M228,109L228,110Z" stroke-width="200px" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
</svg>
</div>
css:
.outer{
width:30%;
height:30%;
}
如何实现 svg 响应式内容?
【问题讨论】:
-
不确定“内容响应”是什么意思。请注意,viewBox="0 0 100% 640" 无效,因为 viewBox 中不允许使用百分比。
-
嘿@Robert viewBox 有什么用。实际上我是 SVG 新手。
-
那是另一个问题。
-
“那是另一个问题”是一种陈规定型的 StackOverflow 傲慢,可能使它对新/不熟悉的用户如此不受欢迎。