一苟呐、三角形
.father {
width: 0px;
height: 0px;
border: 50px solid black;
}
.father {
width: 0px;
height: 0px;
border-top: 50px solid black;
border-right: 50px solid red;
border-bottom: 50px solid green;
border-left: 50px solid blue;
}
// transparent 關(guān)鍵字表示一個完全透明的顏色擂煞,即該顏色看上去將是背景色
.father {
width: 0px;
height: 0px;
border-top: 50px solid black;
border-right: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 50px solid transparent;
}
.caret {
width: 0;
height: 0;
border: 50px solid transparent;
border-top-color: black;
}
// 節(jié)省空間的三角形
.father {
width: 0px;
height: 0px;
border-top: 50px solid black;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
// 等腰梯形
.father {
width: 50px;
height: 0px;
border-top: 50px solid black;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
}
// 中空的圖形
.father {
width: 50px;
height: 50px;
border-top: 50px solid black;
border-right: 50px solid red;
border-bottom: 50px solid green;
border-left: 50px solid blue;
}
// 平形四邊形
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<style>
body {
margin: 0;
padding: 0;
}
.father1 {
position: relative;
width: 0;
height: 0;
border-top: 50px solid black;
border-right: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 50px solid transparent;
}
.father2 {
position: absolute;
top: -50px;
left: 50px;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 50px solid green;
border-left: 50px solid transparent;
}
</style>
</head>
<body>
<div class="father1"></div>
<div class="father2"></div>
</body>
</html>