H5与CSS3绘制三角形

*不使用图标,绘制三角形图案(简单小demo)

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>HTML5与css3之绘画出三角形</title>
</head>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
			text-decoration: none;
		}
		.triangle_up{
			width: 0px;
			height: 0px;
			border: 100px solid transparent;
			border-bottom: 100px solid red;
		}
		.triangle_left{
			width: 0px;
			height: 0px;
			border: 100px solid transparent;
			border-right: 100px solid red;
		}
		.triangle_right{
			width: 0px;
			height: 0px;
			border: 100px solid transparent;
			border-left: 100px solid red;
		}
		.triangle_bottom{
			width: 0px;
			height: 0px;
			border: 100px solid transparent;
			border-top: 100px solid red;
		}
	</style>
<body>
	<div class="triangle_up"></div>
	<div class="triangle_left"></div>
	<div class="triangle_right"></div>
	<div class="triangle_bottom"></div>
</body>
</html>

如图效果:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_41909712/article/details/87940640