如何减少 flexbox 中项目之间的空间 justify-content: space-between

cro*_*dev 1 html css flexbox

我正在为我的网站制作页脚,我正在使用 flexbox 进行布局。这是我页脚的 CSS:

.footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5vh;
  background-color: transparent;
  color: white;
  text-align: center;
}
Run Code Online (Sandbox Code Playgroud)

它看起来像这样:

图片

他们之间有很大的空间。我如何减少那个空间?

如果您需要更多信息,请发表评论。

谢谢!

小智 5

使用 flexbox 的justify-content规则你可以控制菜单项之间的空格

.footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
}
Run Code Online (Sandbox Code Playgroud)

您也可以使用justify-content: centerjustify-content: space-around

https://css-tricks.com/snippets/css/a-guide-to-flexbox/