css实现四边形四角边框效果(没有使用定位,避免布局影响)
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.frame {
display: inline-block;
padding: 7px;
background: linear-gradient(#00ffd4, #00ffd4) left top, linear-gradient(#00ffd4, #00ffd4) left top, linear-gradient(#00ffd4, #00ffd4) right top, linear-gradient(#00ffd4, #00ffd4) right top, linear-gradient(#00ffd4, #00ffd4) left bottom, linear-gradient(#00ffd4, #00ffd4) left bottom, linear-gradient(#00ffd4, #00ffd4) right bottom, linear-gradient(#00ffd4, #00ffd4) right bottom;
background-repeat: no-repeat;
background-size: 2px 20px, 20px 2px;
}
.frame-box {
width: 200px;
height: 200px;
border: #00ffd4 1px solid;
background: rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<div class="frame">
<div class="frame-box">
</div>
</div>
<div class="frame">
<div class="frame-box">
</div>
</div>
</body>
</html>