zl程序教程

您现在的位置是:首页 >  前端

当前栏目

css实现梯形详解编程语言

CSS编程语言 实现 详解
2023-06-13 09:11:47 时间
使用伪元素before和after分别在矩形元素前后加三角形或者直接设置border 使用3d旋转矩形,使之看起来像矩形
 html 

 head 

 meta charset="utf-8" style .trapezoid-0{ border-bottom: 100px solid #fb3; border-left: 50px solid transparent; border-right: 50px solid transparent; height: 0; width: 100px; margin: 0 0 20px 0; } .trapezoid-1{ border-radius: .5em .5em 0 0; margin: 20px; height: 40px; width: 100px; background: #fb3; transform-origin: bottom; transform: scaleY(1.3) perspective(.5em) rotateX(5deg); /*scaleY: 纵轴放大1.3倍,使梯形高度等于height;perspective:3d透视效果,元素距离视图的距离*/ } /style /head body div /div div /div /body /html 

css实现梯形详解编程语言

 

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/17334.html

cjavaxml