通过border属性可以画出一个三角形,代码如下:
<!DOCTYPE html>
<head>
<meta charset=UTF-8">
<title>Document</title>
<style type="text/css">
div{
width: 0px;
height: 0px;
border: 30px solid transparent;
border-bottom: none;
border-top-color:blue;
transition:all 1s ease 0s;
}
div:hover{
transform:rotate(180deg);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
网友评论