css 实现 三角形 梯形

这一生的挚爱 提交于 2020-02-24 01:09:29

在线调试

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
	<style>
		div {  
			width: 0;  
			height: 0;  
			border-width: 100px 100px 100px 100px;
			border-color: red;
			border-style: solid;
			border-left-color: transparent;
			border-top-color: transparent;  
			border-right-color: transparent;
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
	<style>
		div {  
			width: 0;  
			height: 0;  
			border-width: 100px 20px 100px 150px;
			border-color: red;
			border-style: solid;
			border-left-color: transparent;
			border-top-color: transparent;  
			border-right-color: transparent;
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
	<style>
		div {  
			width: 100px;  
			height: 0;  
			border-width: 100px 100px 100px 100px;
			border-color: red;
			border-style: solid;
			border-left-color: transparent;
			border-top-color: transparent;  
			border-right-color: transparent;
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
	<style>
		div {  
			width: 100px;  
			height: 0;  
			border-width: 100px 0 100px 250px;
			border-color: red;
			border-style: solid;
			border-left-color: transparent;
			border-top-color: transparent;  
			border-right-color: transparent;
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

在这里插入图片描述

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
	<style>
		div {  
			width: 100px;  
			height: 0;  
			border-width: 100px 100px 100px 250px;
			border-color: red;
			border-style: solid;
			border-left-color: transparent;
			border-top-color: transparent;  
			border-right-color: transparent;
		}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

在这里插入图片描述

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!