自适应 ——居中—— css实现的方法(flex)
![](https://img.haomeiwen.com/i15912104/18656490b9b674b8.png)
.title{
display:flex;
width:80%;
margin:0 auto;
}
.title .line{
flex:1;position:relative;
top:-11px;
border-bottom: 2px solid #000;
}
.title .text{
padding:0 12px;
font-size: 20px;
} <body>
<div class="title">
<div class="line"></div>
<div class="text">居中</div>
<div class="line"></div>
</div>
本文标题:自适应 ——居中—— css实现的方法(flex)
本文链接:https://www.haomeiwen.com/subject/swqmdqtx.html
网友评论