【发布时间】:2016-09-05 12:02:45
【问题描述】:
我有类似的附加代码(这被剥离了,但问题仍然存在)
在 IE10/10 和 Edge12 中,SVG 不会浮动到容器的右侧,我测试过的所有其他浏览器都可以工作。
为什么会发生这种情况以及如何解决?
body {
background: black;
}
.container {
position: relative;
width: 100%;
height: 300px;
}
.wedge-left {
background: red;
width: 50%;
height: 100%;
position: absolute;
top: 0;
}
svg {
width: auto;
height: 100%;
display: block;
float: right;
}
<div class="container">
<div class="wedge-left">
<svg viewBox="0 0 127 709" xmlns="http://www.w3.org/2000/svg">
<title>wedge-left</title>
<g fill="none" fill-rule="evenodd">
<path d="M114.572-.058h13L15.072 709.5H.5L114.572-.058z" fill-opacity=".5" fill="#FFF" />
<path fill="#e8e5f2" d="M127-.058V709.5H12.928z" />
</g>
</svg>
</div>
</div>
Codepen 示例:http://codepen.io/owenmelbz/pen/Myxwvb
【问题讨论】:
标签: svg css-float internet-explorer-11 internet-explorer-10 microsoft-edge