use the css transform property skewx to skew an element along the x axis - zilongxuan001/LearnFreecode GitHub Wiki
下一个transform
属性的功能是skewX()
,可以在水平角度上扭曲一个元素。
下面的例子是如何在水平的-32度上扭曲<p>
元素
p {
transform: skewX(-32deg);
}
使用transform
属性,在水平角度上扭曲id为bottom
的元素为24度。
<style>
div {
width: 70%;
height: 100px;
margin: 50px auto;
}
#top {
background-color: red;
}
#bottom {
background-color: blue;
transform: skewX(24deg);
}
</style>
<div id="top"></div>
<div id="bottom"></div>
2018-10-30 15:20:39