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

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .up{
            width: 0px;
            height: 10px;
            border-bottom: 10px solid red;
            border-left:10px solid transparent;
            border-right: 10px solid transparent;
            border-top:0;
        }
        .down{
            width: 0px;
            height: 10px;
            border-top: 10px solid red;
            border-left:10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom:0;
        }
        .left{
            height: 0;
            width: 10px;
            border-left:10px solid red;
            border-bottom:10px solid transparent;
            border-top:10px solid transparent;
            border-right:0;
        }
        .right{
            height: 0;
            width: 10px;
            border-right:10px solid red;
            border-bottom:10px solid transparent;
            border-top:10px solid transparent;
            border-left:0;
        }
    </style>
</head>
<body>
    <div class="down"></div>
    <div class="left"></div>
    <div class="right"></div>
    <div class="up"></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)容

  • 今天學(xué)到的兩種方式可以實(shí)現(xiàn)三角形,簡(jiǎn)單寫一下 方法一: html代碼: 我是三角形 css代碼如下:用偽元素實(shí)現(xiàn)一...
    石子1110閱讀 600評(píng)論 0 0
  • html 因?yàn)槊總€(gè)圖形都有一些共同的樣式,所以為每個(gè)div設(shè)置兩個(gè)class,一個(gè)公共的class,一個(gè)各自的cl...
    李永州的FE閱讀 345評(píng)論 0 0
  • 我們?cè)谑褂肅SS框架的時(shí)候,經(jīng)常會(huì)用到下拉框組件,一般該組件里面有個(gè)下三角。此外,我們經(jīng)常用的tooltip,一般...
    康斌閱讀 19,694評(píng)論 18 61
  • 我們經(jīng)常在逛網(wǎng)頁(yè)的時(shí)候,會(huì)看到一些三角形,比如下面這張圖,個(gè)人中心后面有個(gè)三角形,那么我們?nèi)绾卫胏ss樣式來(lái)繪制...
    雅玲啞鈴閱讀 1,430評(píng)論 1 11
  • 最近在逛某個(gè)技術(shù)網(wǎng)站的時(shí)候,感覺文章關(guān)鍵詞上的樣式好酷炫啊,分頁(yè)的樣式。來(lái)張截圖: 你在首頁(yè)的底部也可以看到這樣一...
    web前端學(xué)習(xí)閱讀 1,050評(píng)論 0 4

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