用CSS製作一個三角形!

用CSS製作一個三角形!

<style>
        .outer {
            width: 0;
            height: 0;
         border-left: 10px solid transparent;
         border-right: 10px solid #ccc;
         border-top: 10px solid transparent;
         border-bottom: 10px solid #ccc;
        }
    </style>
</head>

<body>
    <div class="outer"></div>
</body>

簡單寫法

<style>
        .outer {
            width: 0;
            height: 0;
            border: 50px solid transparent;
            border-top-color: pink;
        }
    </style>
</head>

<body>
    <div class="outer"></div>
</body>

相關文章
相關標籤/搜索