小编Ale*_*llo的帖子

CSS Flex 溢出和居中

我正在尝试水平对齐一些元素。当元素很少时,我希望它们位于中心。这是有很多的地方,我想要一个水平滚动。

但是有一个问题,第一个和第二个元素被隐藏了。

.container {
    display: flex;
    flex-direction: row;
    justify-content: center ;
    overflow: scroll;
}

item {
      width: 440px ;
      height: 240px;
      flex-shrink: 0;
}
Run Code Online (Sandbox Code Playgroud)

例子:

.container {
    display: flex;
    flex-direction: row;
    justify-content: center ;
    overflow: scroll;
}

item {
      width: 440px ;
      height: 240px;
      flex-shrink: 0;
}
Run Code Online (Sandbox Code Playgroud)
.projets {
  display: flex;
  flex-direction: row;
  justify-content: center;
  overflow: scroll;
}

.projets .projet_outter {
  width: 440px;
  height: 240px;
  flex-shrink: 0;
}

.projets .projet {
  border-radius: 10px;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, …
Run Code Online (Sandbox Code Playgroud)

html css flexbox

6
推荐指数
1
解决办法
4000
查看次数

标签 统计

css ×1

flexbox ×1

html ×1