1、
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
.triangle{
width: 0;
height: 0;
border:50px solid red;
border-top-color: transparent;
border-right-color: transparent;
border-left-color: transparent;
}
</style>
</head>
<body>
<div class="triangle"></div>
</body>
</html>
实现效果:
2、直角
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
.triangle{
width: 0;
height: 0;
border: 50px solid red;
border-top-color: transparent;
border-right-color: transparent;
border-left-color: red;
}
</style>
</head>
<body>
<div class="triangle"></div>
</body>
</html>
实现效果: