CSS三角形绘制

阅读 210

2022-03-12

CSS三角形绘制

思路

  1. 让宽高为0。(eg:width:0;eheight:0)
  2. 让边框变大。(eg:border:100px solid;)
  3. 让边框的其他三边为透明 transparent。代码如下:
		#tup{
			height: 0px;
			width: 0px;
			border: 100px solid;
			border-top-color: transparent;
			border-bottom-color: red;
			border-left-color: transparent;
			border-right-color: transparent;
		}

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

精彩评论(0)

0 0 举报