我想创建使用CSS的横向div。 我想创建看起来像在下面的图像显示。 following image如何使用css创建横向div?
0
A
回答
1
您可以使用:
transform: skew();
在你的CSS
。
工作实例:
body {
margin: 0;
}
.intro {
position: relative;
width: 65vw;
height: 100vh;
left: -15vw;
background-color: rgb(47, 47, 47);
transform: skew(-10deg);
}
<div class="intro">
</div>
0
这样的事情? 这是一个快速的复制/粘贴,我的网站上我犯了发现..
https://codepen.io/biroplane/pen/NpLrvE
#sx {
-webkit-clip-path: polygon(0 0, 95% 0, 74% 100%, 0% 100%);
clip-path: polygon(0 0, 100% 0, 84% 100%, 0% 100%);
background-image: url('https://unsplash.it/1920/1080/?random');
//background-image: url('http://loremflickr.com/1920/1080/dog,cat');
background-position: center center;
background-clip: border-box;
background-repeat: no-repeat;
background-size: cover !important;
background-attachment: scroll;
overflow: scroll;
width: 50vw !important;
height: 100vh;
display: flex;
align-items: center;
align-content: center;
flex-direction: column;
transition: all 0.5s cubic-bezier(.34, -0.32, .42, 1.34);
&:hover {
border: 10px solid white;
width: 100vw !important;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
~ #dx {
//width:100vw !important;
}
h1 {
//margin-left: 25vw;
color: white;
@include textlongshadow(#222);
}
img {
//margin-left: 25vw;
@include longshadow();
//-webkit-filter:drop-shadow(10px 10px 10px white) drop-shadow(20px 20px 10px red);
//longdrop(20,#222);
}
}
相关问题
- 1. 使用HTML和CSS创建横向和纵向布局
- 2. 使用css创建div
- 3. Windows Metro:如何创建没有列表视图的横向div?
- 4. CSS横向导航,IMG或DIV?
- 5. 如何创建使用CSS
- 6. 横向切割div
- 7. 使用CSS创建缩进DIV
- 8. CSS使用div创建列布局
- 9. 使用三个div来创建CSS
- 10. 横向CSS布局
- 11. 如何在css div中创建圈子?
- 12. 如何在CSS中创建div堆栈?
- 13. 如何创建背景CSS div /圆角?
- 14. 如何为纵向和横向布局创建UIView
- 15. 如何为横向和纵向创建图像集?
- 16. 如何使用phonegap构建支持纵向和横向闪屏?
- 17. 如何用roslyn创建数字横向标记?
- 18. 如何在运行时使用指定的css创建div
- 19. 使用CSS移动查询禁用横向或纵向方向
- 20. 使用CSS创建垂直定向表
- 21. 如何使横向菜单
- 22. 如何使用简单的css创建uparrow向下箭头
- 23. 如何使用css创建方向两个箭头?
- 24. 使用内嵌css动画创建html横幅广告
- 25. 当横向打开应用程序时,新创建的UIWindow横向
- 26. 如何使用JavaScript动态创建div?
- 27. 如何使用jQuery创建div
- 28. 如何使用while循环创建'div'
- 29. 如何使用div创建页面
- 30. 如何使用jQuery创建250个div?
后你的代码到目前为止 – LGSon