<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.box::after{
content: '';
width: 50px;
height: 2px;
background-color: bisque;
display: block;
margin-top: 2px;
}
.border{
position: relative;
margin-top: 20px;
}
.border::before{
content: '';
position: absolute;
left: 50px;
border: 10px solid transparent;
border-left-color: blueviolet;
}
/* .border{
border: 10px solid transparent;
border-left-color: blue;
} */
</style>
</head>
<body>
<div class="box">图片</div>
<div class="border">三角形</div>
</body>
</html>
使用伪类选择器实现下划线和三角形
最新推荐文章于 2024-02-28 10:30:30 发布