日常随记
css如何实现一个三角形
<!DOCTYPE html>
<html>
<head>
<style>
#div1 {
width: 140px;
border-bottom: 50px solid #ccc;
border-right: 140px solid transparent;
}
</style>
</head>
<body>
<div id="div1">
</div>
</body>
</html>
效果图:
css如何实现一个直角梯形
<!DOCTYPE html>
<html>
<head>
<style>
#div1 {
width: 0;
height: 0;
border-left: 60px solid transparent;
border-right: 60px solid transparent;
border-bottom: 120px solid skyblue;
}
</style>
</head>
<body>
<div id="div1">
</div>
</body>
</html>
效果图: