百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>html5教程> 对于Html和CSS绘制三角形图标的办法
分享文章到:

对于Html和CSS绘制三角形图标的办法

发布时间:09/01 来源:未知 浏览: 关键词:
这篇文章主要为大家具体介绍了Html+CSS绘制三角形图标的相关代码,许多网页都有三角形的图标,平常是切的图片,这里可以用css3+html写出三角形,感乐趣的小伙伴们可以参照 一下

先看看结果图:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        #test1 {   
            height:20px;   
            width:20px;   
            border-color:#FF9600 #3366ff #12ad2a #f0eb7a;   
            border-style:solid;   
            border-width:20px;   
        }   
        #test2 {   
            height:0;   
            width:0;   
            overflow: hidden; /* 这里设定overflow, font-size, line-height */   
            font-size: 0;     /*是由于, 虽然宽高度为0, 但在IE6下会具有默许的 */   
            line-height: 0;  /* 字体大小和行高, 致使盒子显现被撑开的长矩形 */   
            border-color:#FF9600 #3366ff #12ad2a #f0eb7a;   
            border-style:solid;   
            border-width:20px;   
        }   
        #test3 {   
            height:0;   
            width:0;   
            overflow: hidden;   
            font-size: 0;   
            line-height: 0;   
            border-color:#FF9600 transparent transparent transparent;   
            border-style:solid;   
            border-width:20px;   
        }   
        #test4 {   
            height:0;   
            width:0;   
            overflow: hidden;   
            font-size: 0;   
            line-height: 0;   
            border-color:#FF9600 transparent transparent transparent;   
            border-style:solid dashed dashed dashed;   
            border-width:20px;   
        }/*兼容IE6*/   
        #test5 {   
            height:0;   
            width:0;   
            overflow: hidden;   
            font-size: 0;   
            line-height: 0;   
            border-color:#FF9600 #3366ff transparent transparent;   
            border-style:solid solid dashed dashed;   
            border-width:40px 40px 0 0 ;   
        }   
    </style>
</head>
<body>
    <p id="test1"></p><br>
    <p id="test2"></p><br>
    <p id="test3"></p><br>
    <p id="test4"></p><br>
    <p id="test5"></p><br>
</body>
</html>

以上就是本文的全部内容,但愿对大家的学习有所帮忙,更多相关内容请关注PHP中文网!

相关引荐:

用HTML5 Canvas来绘制三角形和矩形等多边形的办法

使用HTML5和CSS3实现生日蛋糕的制作

以上就是关于Html和CSS绘制三角形图标的办法的具体内容,更多请关注百分百源码网其它相关文章!

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有151人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板