用CSS绘制实体三角形并说明原理

.test{ width:0;height:0;margin:0 auto;border:6px solid transparent;border-top: 6px solid red;}
查看代码
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>绘制基本图形</title>
	</head>
	<style type="text/css">
	*{
		margin: 0;
		padding: 0;
	}
		
		body{
			position: relative;
			/* right: 100px; */
			
		}
		.box1{
			width: 0;
			height: 0;
			border-left: 50px solid rgba(0,0,255,0);
			border-right: 50px solid rgba(0,255,0,0);
			border-bottom: 100px solid rgba(255,0,0);
			position: absolute;
			left:100px;
			top:150px;
			transition: all 0.8s linear;
		}
		
		.box1:hover {
			border-bottom: 100px solid rgba(0,222,14);
			transition: all 0.8s linear;
		}
		
		h2 {
			color: aqua;
			font-weight: 700;
			display: inline-block;
			transition: all 0.8s linear;
			
		}
		
		h2:hover {
			color: red;
			font-weight: 700;
			transition: all 0.8s linear;
			
		}
		
	</style>
	<body>
		<!-- <div id="box"></div> -->
		<div class="box1"></div>
		<div class="f">
			<h2>
				符攀飞
			</h2>
		</div>
		
	</body>
</html>
posted @   符攀飞  阅读(62)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端

阅读目录(Content)

此页目录为空

点击右上角即可分享
微信分享提示