【发布时间】:2015-02-26 15:46:55
【问题描述】:
我一直在尝试让 CSS 形状跨浏览器工作,我已经让它在 Chrome 和 Safari 中运行没有任何问题,我似乎无法让它在 Firefox 中运行(尚未测试 IE,不期待那个)。
这是 HTML:
<div class="container">
<section class="hero">
<section class="slide">
<div class="shaped"></div>
<div class="hero-text">
<h2>PROFESSIONAL PROPERTY MAINTENANCE SERVICES FOR BUSINESSES</h2>
<p>Throughout the Northwest of England including Liveprool, Manchester, Preston, Wigan and St. Helens</p>
</div>
</section>
</section>
</div>
这是 CSS:
.container {
width: 960px;
margin: 0 auto;
}
section.hero {
padding: 8px;
box-sizing: border-box;
overflow: hidden;
width: 100%;
height: 400px;
float:left;
section.slide {
position:relative;
.shaped {
background-size: cover;
shape-outside: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
background-image: url(http://www.e-architect.co.uk/images/jpgs/aberdeen/bon_accord_centre_tonyfreeman221207_04.jpg);
height: 384px;
float:left;
width: 70%;
float: right;
shape-margin: 20px;
}
.hero-text {
box-sizing: border-box;
background-color: #333;
color: white;
padding: 30px;
height: 384px;
width: 50%;
h2 {
margin-bottom: 20px;
}
}
}
}
我尝试了一个 Adobe 形状的 polyfill,但没有任何区别,还有其他选择吗?或者我应该考虑完全改变设计吗?
谢谢
【问题讨论】:
标签: html css firefox svg css-shapes