【发布时间】:2023-01-18 01:03:37
【问题描述】:
justify-content: space-evenly;
工作正常但没有得到预期的输出
实际上我想要实现的是
这是我可以创造的
让我告诉你我的代码
function App() {
return (<div className="App">
<div className={'card'}>
// My Stuff
<Footer/>
</div>
</div>);
}
function Footer() {
return (<div className={'footer'}>
<img src={TwitterIcon}/>
<img src={FaceBookIcon}/>
<img src={InstagramIcon}/>
<img src={GithubIcon}/>
</div>)
}
body {
margin: 0;
background-color: #23252C;
}
.App {
display: flex;
align-items: center;
justify-content: center;
/*height: 100vh;*/
margin-top: 50px;
margin-bottom: 50px;
background-color: #23252C;
padding-bottom: 0px;
}
.card {
border-radius: 08px;
overflow: hidden;
background-color: #1A1B21;
max-width: 28%;
padding-bottom: 0px;
}
.footer {
background-color: #161619;
padding: 15px 10px 15px 10px;
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
align-items: center;
overflow: hidden;
}
【问题讨论】:
-
将
justify-content: space-evenly更改为justify-content: center并尝试使用gap。请记住IE doesn't supportgap。 -
感谢@RicoHancock
justify-content: space-evenly填充它的作品