nav导航栏每个子元素居中对齐,两边留边距
Sonder
2023-05-10
283字
1分钟
浏览 (1.1k)
nav导航栏每个子元素居中对齐,两边留边距
.nav-bar {
display: flex;
align-items: center;
margin: 0 auto;
width: 100%;
justify-content: space-between;
flex-wrap: wrap;
}
.nav-bar:before,.nav-bar:after {
display: table;
content: " ";
}
.nav-bar:after {
clear: both;
}
![image.png](https://s2.loli.net/2023/05/10/QmSHb2FdMDJztKw.png)