国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開(kāi)發(fā) > CSS > 正文

純CSS畫(huà)的基本圖形(矩形、圓形、三角形、多邊形、愛(ài)心、八卦

2024-07-11 08:35:17
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

圖形包括基本的矩形、圓形、橢圓、三角形、多邊形,也包括稍微復(fù)雜一點(diǎn)的愛(ài)心、鉆石、陰陽(yáng)八卦等。當(dāng)然有一些需要用到CSS3的屬性,所以在你打開(kāi)這篇文章的時(shí)候,我希望你用的是firefox或者chrome,當(dāng)然IE也能看一部分的。那好,下面就一起來(lái)看看我們是如何用純CSS來(lái)畫(huà)這些圖形的,如果你也覺(jué)得很震撼,推薦給你的朋友吧。

#square {
width: 100px;
height: 100px;
background: red;
}
#rectangle {
width: 200px;
height: 100px;
background: red;
}
#circle {
width: 100px;
height: 100px;
background: red;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
}
#oval {
width: 200px;
height: 100px;
background: red;
-moz-border-radius: 100px / 50px;
-webkit-border-radius: 100px / 50px;
border-radius: 100px / 50px;
}
#triangle-up {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red;
}
#triangle-down {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 100px solid red;
}
#triangle-left {
width: 0;
height: 0;
border-top: 50px solid transparent;
border-right: 100px solid red;
border-bottom: 50px solid transparent;
}
#triangle-right {
width: 0;
height: 0;
border-top: 50px solid transparent;
border-left: 100px solid red;
border-bottom: 50px solid transparent;
}
#triangle-topleft {
width: 0;
height: 0;
border-top: 100px solid red;
border-right: 100px solid transparent;
}
#triangle-topright {
width: 0;
height: 0;
border-top: 100px solid red;
border-left: 100px solid transparent;

}
#triangle-bottomleft {
width: 0;
height: 0;
border-bottom: 100px solid red;
border-right: 100px solid transparent;
}
#triangle-bottomright {
width: 0;
height: 0;
border-bottom: 100px solid red;
border-left: 100px solid transparent;
}
#parallelogram {
width: 150px;
height: 100px;
margin-left:20px;
-webkit-transform: skew(20deg);
-moz-transform: skew(20deg);
-o-transform: skew(20deg);
background: red;
}
#trapezoid {
border-bottom: 100px solid red;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
height: 0;
width: 100px;
}
#star-six {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 100px solid red;
position: relative;
}
#star-six:after {
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 100px solid red;
position: absolute;

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 宾川县| 泾阳县| 宝坻区| 邵阳市| 交口县| 剑河县| 缙云县| 米泉市| 巴马| 九龙县| 广宁县| 原阳县| 丽江市| 托克逊县| 锡林郭勒盟| 县级市| 海安县| 承德市| 原阳县| 上林县| 大港区| 上蔡县| 巧家县| 雅安市| 城固县| 临潭县| 泸西县| 唐河县| 石渠县| 余干县| 宁城县| 巴青县| 太仓市| 镇巴县| 突泉县| 嘉鱼县| 桦川县| 平山县| 新龙县| 永安市| 孙吴县|