伪类编写边框

来源:互联网 发布:律师事务所 知乎 编辑:程序博客网 时间:2024/06/07 14:23
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.main{
width: 300px;
height: 30px;
background-color: #CCCCCC;
position: relative;
z-index: 2;
}
.main:before{
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 0;
transform: scale(0.5);
transform-origin: left top;
border-bottom: 1px solid red;
}
</style>
</head>
<body>
<div class="main">测试测试</div>
</body>
</html>
0 0
原创粉丝点击