如何使用 CSS3 和 HTM5 建立具有不規則形狀的 div?


使用 CSS3,您始終可以建立矩形、三角形等形狀。

讓我們來看看做法 −

以下為矩形 −

#shape1 {
   width: 300px;
   height: 150px;
   background: blue;
}

以下為三角形 −

#shape2 {
   width: 0;
   height: 0;
   border-left: 200px solid transparent;
   border-bottom: 200px solid blue;
}

更新於: 2020 年 6 月 25 日

487 次瀏覽

開啟你的 職業生涯

完成課程以獲得認證

開始
廣告
© . All rights reserved.