国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 伊春市| 平泉县| 黄龙县| 上虞市| 沙河市| 大英县| 简阳市| 高雄市| 高密市| 岳池县| 盐边县| 新野县| 玉林市| 郸城县| 江川县| 荆门市| 凤阳县| 正定县| 雷山县| 翼城县| 边坝县| 台南县| 罗山县| 庄浪县| 吉水县| 泸溪县| 庆阳市| 陇南市| 景德镇市| 德州市| 灵宝市| 钟山县| 彭阳县| 容城县| 普兰县| 土默特左旗| 通榆县| 光山县| 济源市| 庄河市| 双鸭山市|