CSS中左上朝向三角形(Top-Left Triangle)的几种制作方式
今天我们介绍几种,用css实现左上朝向三角形(Top-Left Triangle)的写法。
示意图(以宽高各60px为例):
这种三角形,一般可以用来做“对话框”类型图形的左下小脚。
第一种:
#triangle-topleft {
border: 30px solid #e6686e;
height: 0;
width: 0;
border-right-color: transparent;
border-bottom-color: transparent;
}第二种:
#triangle-topleft {
width: 0;
height: 0;
border-top: 60px solid #e6686e;
border-right: 60px solid transparent;
}第三种:
#triangle-topleft {
border: 60px solid transparent;
width: 0;
height: 0;
border-left-color: #e6686e;
border-top-width: 0;
}大家可以尝试更多种的三角形做法,以及不同朝向的三角形。
这里强烈推荐一个常用css图形的展示网站:https://css-tricks.com/the-sh...
Written by:EdenSheng
Email:[email protected]
相关推荐
Ydgent 2016-01-21
yibawuqing 2019-06-25
dxbjfu0 2019-06-20
MegatronKings 2018-07-17
跨越美利坚面试创业技术培训 2018-05-30