css 绘制直角梯形 和 平行四边形
生活随笔
收集整理的這篇文章主要介紹了
css 绘制直角梯形 和 平行四边形
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<div:class="{isFirst: index === 0,tab_item: index !== 0,}":style="{width: item?.label?.length > 4 ? '206px' : '137px',}"><div>{{ item.label }}</div></div>
isFirst是直角梯形 tab_item是平行四邊形?
直角梯形
????????
.isFirstcursor pointerwidth: 107px;height: 0px;border: 0px solid transparentborder-bottom: 42px solid $background;border-right: 42px solid transparentdisplay: flexjustify-content: centerdivposition: relativetop: vh(12)left: vw(5)?平行四邊形
.tab_itemcursor: pointer;width: 137px;height: 100%;background-color: $background;position: relative;transform: skew(46deg);display: flexjustify-content: centeralign-items: centerleft: vw(-15)margin-right: vw(5)divtransform: skew(-46deg);總結
以上是生活随笔為你收集整理的css 绘制直角梯形 和 平行四边形的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 设计模式6大基本原则
- 下一篇: 基于python的WEIBO热点话题检测