您可以使用一个元素:before和:after伪元素来完成此操作.
.el {
position: relative;
display: inline-block;
text-align: center;
line-height: 100px;
background: #89C3EE;
margin: 50px 150px;
width: 100px;
height: 100px;
border: 3px solid #6295DC;
border-radius: 50%;
}
.el:before,
.el:after {
content: 'Text';
position: absolute;
height: 50px;
line-height: 50px;
width: 100px;
top: 50%;
transform: translateY(-50%);
background: #89C3EE;
border-top: 3px solid #6295DC;
border-bottom: 3px solid #6295DC;
}
.el:before {
width: 150px;
left: -143px;
}
.el:after {
right: -94px;
}Run Code Online (Sandbox Code Playgroud)
<div class="el">Text</div>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
112 次 |
| 最近记录: |