栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > Html/CSS > CSS教程

用CSS属性transparent实现各种三角形示例代码

CSS教程 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

效果图如下

示例代码




    
    
    
 *{
     margin: 0;
     padding: 0;
 }
 .box{
     margin: 40px auto;
     width: 60px;
     background-color: #f0ac6b;
 }
 .t1{
     margin: 40px auto;
     width: 0px;
     height: 0px;
     
     border-bottom: 40px solid red;
     border-right: 20px solid transparent;
     border-left: 20px solid transparent;
 }
 .t2{
     margin: 40px auto;
     width: 0px;
     height: 0px;
     
     border-bottom: 40px solid transparent;
     border-right: 40px solid red;
     
 }
 .t3{
     margin: 40px auto;
     width: 0;
     height: 0;
     border-top: 40px solid red;
     border-right: 20px solid transparent;
     border-left: 20px solid transparent;
 }
 .t4{
     margin: 40px auto;
     width: 0;
     height: 0;
     border-top: 40px solid transparent;
     border-left: 40px solid red;
 }
 .t5{
     margin: 40px auto;
     width: 0;
     height: 0;
     border-top: 40px solid red;
     border-right: 40px solid transparent;
 }
 .t6{
     margin: 40px auto;
     width: 0px;
     height: 0px;
     border-left: 40px solid transparent;
     border-bottom: 40px solid red;
 }
 .t7{
     margin: 40px auto;
     width: 0;
     height: 0;
     border-left: 40px solid red;
     border-bottom: 20px solid transparent;
     border-top: 20px solid transparent;
 }
 .t8{
     margin: 40px auto;
     width: 0;
     height: 0;
     border-right: 40px solid red;
     border-bottom: 20px solid transparent;
     border-top: 20px solid transparent;
 }
    



    
    
    
    
    
    
    
    



总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/215601.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号