css實(shí)現(xiàn)三角

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style type="text/css">
        /*箭頭向上*/
        
        .arrow-up {
            width: 0;
            height: 0;
            border-left: 30px solid transparent;
            border-right: 30px solid transparent;
            border-bottom: 30px solid #fea;
        }
        /*箭頭向下*/
        
        .arrow-down {
            width: 0;
            height: 0;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
            border-top: 20px solid #0066cc;
        }
        /*箭頭向左*/
        
        .arrow-left {
            width: 0;
            height: 0;
            border-top: 30px solid transparent;
            border-bottom: 30px solid transparent;
            border-right: 30px solid yellow;
        }
        /*箭頭向右*/
        
        .arrow-right {
            width: 0;
            height: 0;
            border-top: 50px solid transparent;
            border-bottom: 50px solid transparent;
            border-left: 50px solid green;
        }
    </style>
</head>

<body>
    <div class="arrow-up">
        <!--向上的三角-->
    </div>
    <div class="arrow-down">
        <!--向下的三角-->
    </div>
    <div class="arrow-left">
        <!--向左的三角-->
    </div>
    <div class="arrow-right">
        <!--向右的三角-->
    </div>
</body>

</html>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 各種純css圖標(biāo) CSS3可以實(shí)現(xiàn)很多漂亮的圖形,我收集了32種圖形,在下面列出。直接用CSS3畫出這些圖形,要比...
    劍殘閱讀 9,988評(píng)論 0 8
  • 1.長(zhǎng)方形 #Rectangle{ width: 200px; height: 50px; background-...
    一直以來(lái)都很好閱讀 556評(píng)論 0 0
  • 5.橢圓 #ellipse{ width: 200px; height: 100px; background-co...
    小茶葉葉閱讀 2,216評(píng)論 0 1
  • 1、垂直對(duì)齊 如果你用CSS,則你會(huì)有困惑:我該怎么垂直對(duì)齊容器中的元素?現(xiàn)在,利用CSS3的Transform,...
    kiddings閱讀 3,300評(píng)論 0 11
  • 和風(fēng),綠柳,蟬,本該是一年中最愜意的時(shí)節(jié)。 陽(yáng)光灑在六年五班的窗臺(tái)上,掉了綠皮漆的框,露出斑駁的卡其色年輪。 粉筆...
    陳穩(wěn)閱讀 162評(píng)論 0 0

友情鏈接更多精彩內(nèi)容