欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          如何利用css畫(huà)出一個(gè)三角形

          首先我們來(lái)看一下效果圖:

          (視頻教程推薦:css視頻教程)

          如何利用css畫(huà)出一個(gè)三角形

          實(shí)現(xiàn)代碼:

          <!DOCTYPE html> <html> <head>     <title></title>     <style type="text/css">         /* css3繪制三角形 */         .triangle{             width: 0px;                           /*設(shè)置寬高為0,所以div的內(nèi)容為空,從才能形成三角形尖角*/             height: 0px;             border-bottom: 200px solid #00a3af;             border-left: 200px solid transparent;    /*transparent 表示透明*/             border-right: 200px solid transparent;         }     </style> </head> <body>     <div class="triangle"></div> </body> </html>

          還是不理解的小伙伴可以看下面

          1、設(shè)置div有一定寬高,四邊設(shè)置邊框

          .triangle{ 	width: 50px; 	height: 50px; 	border-top: 200px solid #00a497; 	border-bottom: 200px solid #cc7eb1; 	border-left: 200px solid #165e83; 	border-right: 200px solid #c85179; }

          上面代碼設(shè)置div有一定寬高,四邊設(shè)置邊框時(shí),效果如下:

          如何利用css畫(huà)出一個(gè)三角形

          2、設(shè)置div寬高為0,四邊設(shè)置邊框?qū)挾葹?00px

          .triangle{    width: 0px;    height: 0px;    border-top: 200px solid #00a497;    border-bottom: 200px solid #cc7eb1;    border-left: 200px solid #165e83;    border-right: 200px solid #c85179; }

          上面代碼設(shè)置div寬高為0,四邊邊框設(shè)置不同顏色時(shí),效果如下:

          如何利用css畫(huà)出一個(gè)三角形

          (相關(guān)教程推薦:CSS教程)

          3、接下來(lái)div寬高仍為0,去掉border-top

          .triangle{    width: 0px;    height: 0px;    border-bottom: 200px solid #cc7eb1;    border-left: 200px solid #165e83;    border-right: 200px solid #c85179; }

          上面代碼設(shè)置div寬高為0,只設(shè)置下邊框和左右邊框時(shí),效果如下:

          如何利用css畫(huà)出一個(gè)三角形

          4、最后發(fā)現(xiàn),只將border-bottom設(shè)置顏色,左右邊框透明,既可得到三角形

          .triangle{ 	width: 0px; 	height: 0px; 	border-bottom: 200px solid #cc7eb1;     border-left: 200px solid transparent;     border-right: 200px solid transparent; }

          最終效果:

          如何利用css畫(huà)出一個(gè)三角形

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)