解決方案就在這裏(編輯,現在和fl更清潔靈活):
DEMO:jsFiddle
HTML:
<div class='section clearfix'>
<div class='section-content section-col section-col-left'>
<div class='padding'>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div> <!-- end of .section-content -->
<div class='section-bar clearfix'>
<table>
<tr>
<td><a href=''>item 1</a></td>
<td><a href=''>item 2</a></td>
<td><a href=''>item 3</a></td>
</tr>
</table>
</div> <!-- end of .section-bar -->
<div class='section-bg' style='background-image: url("http://www.ysecit.com/css/images/bg-original.jpg")'> </div>
CSS:
*{
padding: 0;
margin: 0;
text-decoration: none;
box-sizing: border-box
}
.clearfix {
display: table;
}
.clarfix ::after{
content: "";
display: block;
clear: both;
}
.padding{
padding: 40px;
}
.section {
position:relative;
overflow: hidden;
}
.section-col{
}
.section-col-left {
float: left
}
.section-content {
width: 50%;
left: 0;
z-index: 3;
position: relative;
}
.section-content::before {
display: block;
width: 0;
content: "";
position: absolute;
top: 0;
right: -40px;
border: 1000px solid #fff;
border-right: 200px solid transparent;
z-index: 2;
}
.section-content div {
position: relative;
z-index: 3;
}
.section-bg {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: cover;
background-position: top right;
background-repeat: no-repeat;
}
.section-bar {
position: absolute;
bottom: 0;
width: 100%;
background: #000;
z-index: 2
}
.section-bar table {
float: right;
}
.section-bar table tr td {
padding: 10px
}
.section-bar table tr td a{
color: #fff
}
你必須相應地創建它們作爲兩個獨立的半和位置(或者只是剪切圖像並放在div上方)。看看http://stackoverflow.com/questions/30441122/shape-with-a-slanted-side-responsive關於如何產生這種形狀的信息。 220px:不是一個確切的重複數據刪除,但你可以使用相同的技術(SVG,剪輯路徑等) – Harry