div 画虚线

2020-12-22  

<style>
* {
	margin:0;
	padding:0;
}
.table-dashed {
	background-color:#BCD8F9;
	margin:0;
	padding:0;
}
.table-dashed::before {
	content: '';
	display: inline-block;
	border-style:dashed;
    border-width:1px;
	border-color:#0075FF;
	width:100%;
	height:10px;
	position:absolute;
	left:0px;
}
.table-dashed::after {
	content: '';
	display: inline-block;
	border-style:dashed;
    border-width:1px;
	border-color:#0075FF;
	width:100%;
	height:20px;
	position:absolute;
	left:0px;
}
</style>
<body>
<div style="position:relative;margin:50px auto;width:200px;">
	<div class="table-dashed">111</div>
</div>
</body>

 

效果:

 

ConstXiong 备案号:苏ICP备16009629号-3