首页 > 代码库 > css 实现三角形

css 实现三角形

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#demo {
width: 0;
height: 0;
border-width: 200px;
border-style: solid;
border-color: transparent transparent red transparent;
}
.d2{
width:400px;
height:200px;
background-color: orange;
}
</style>
</head>
<body>
<div id="demo">

</div>
<div class="d2"> <img src="http://www.mamicode.com/01_03.png" ></div>
</body>
</html>

css 实现三角形