试试这个
HTML
<div class="container">
<div class="main">
<div class="main-container">
<section>
<h1>Content</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et est urna. Pellentesque hendrerit lobortis tincidunt. Sed et malesuada ante. Donec sit amet molestie libero. Nam sed gravida nunc. Ut porttitor rhoncus volutpat. Quisque eu sollicitudin quam. Quisque tempor justo eget sodales maximus.
Ut pharetra nulla sit amet augue vulputate pharetra. Nulla facilisis turpis vel velit commodo, eget feugiat leo tincidunt. Aenean consequat sapien vitae porttitor euismod. Quisque dictum vitae erat ac commodo. Nunc cursus a dolor et rutrum. Nunc lobortis a urna eu auctor. Curabitur cursus diam non lect</p>
</section>
</div>
</div>
</div>
CSS
.container {
padding-top: 97px;
}
.main-container {
background: #00b7ea;
background: -moz-linear-gradient(top, #00b7ea 49%, #009ec3 100%);
background: -webkit-linear-gradient(top, #00b7ea 49%,#009ec3 100%);
background: linear-gradient(to bottom, #00b7ea 49%,#009ec3 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#009ec3',GradientType=0 );
position: relative;
height: 220px;
}
.main-container:before {
content: '';
position: absolute;
left: 0;
top: -53px;
width: 100%;
height: 95px;
background: #00b7ea;
-webkit-transform: skewY(8.5deg);
-moz-transform: skewY(8.5deg);
-ms-transform: skewY(8.5deg);
-o-transform: skewY(8.5deg);
transform: skewY(8.5deg);
-webkit-backface-visibility: hidden;
}
section {
margin: 10px auto;
padding: 0 20px;
padding-bottom: 10px;
position: relative;
max-width: 600px;
}
这是小提琴:https ://jsfiddle.net/c1pgeq7j/4/
尝试使用transform: skewY(8.5deg);
倾斜的另一侧和渐变尝试检查colorzilla。