您的位置:首页 > Web前端 > CSS

在CSS3中制作小三角形效果代码

2015-05-26 16:38 399 查看

使用CSS3实现小三角的制作:

html代码:

<div class="arrow-up"></div><!--向上的三角-->

<div class="arrow-right"></div><!--向右的三角-->

<div class="arrow-down"></div><!--向下的三角-->

<div class="arrow-left"></div><!--向左的三角-->

CSS3样式部分:

.arrow-up{

width:0;

height:0;

border-left:30px solid transparent;

border-right:30px solid transparent;

border-bottom:30px solid #f00;

}

.arrow-right {

width:0;

height:0;

border-top:20px solid transparent;

border-bottom: 20px solid transparent;

border-left: 20px solid green;

}

.arrow-down {

width:0;

height:0;

border-left:40px solid transparent;

border-right:40px solid transparent;

border-top:40px solid #ccc;

}

.arrow-left {

width:0;

height:0;

border-top:30px solid transparent;

border-bottom:30px solid transparent;

border-right:30px solid #00f;

}

效果图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: