试图创建一个像下面的小提琴那样的视角倾斜形状并挣扎。到目前为止,我可以正确地工作,但我似乎无法让左下角更像梯形。我发现的最接近的是:How to create fluid trapezoid image with css?但这是用于图像。CSS创建此形状仅作为背景,内容保持直接
代码是:
<div class="we-are">
<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
.we-are {
background-color: orange;
height:450px;
-ms-transform:skewY(10deg); /* IE 9 */
-moz-transform:skewY(10deg); /* Firefox */
-webkit-transform:skewY(10deg); /* Safari and Chrome */
-o-transform:skewY(10deg); /* Opera */
transform:skewY(10deg);
padding:15px;
}
.we-are p {
padding-top: 125px;
-ms-transform:skewY(-10deg); /* IE 9 */
-moz-transform:skewY(-10deg); /* Firefox */
-webkit-transform:skewY(-10deg); /* Safari and Chrome */
-o-transform:skewY(-10deg); /* Opera */
transform:skewY(-10deg);
}
当前小提琴是:
感谢
你想要这个 - http://jsfiddle.net/x6bkbeqc/1/ ?? –
不 - 两个右边的角落应该比左边的那个更接近:) – Jolen
这一个 - http://jsfiddle.net/x6bkbeqc/2/ ?? –