小编Raf*_*tes的帖子

有没有办法用 display: flex 做一个像 Pinterest 这样的画廊?

我试图了解 CSSdisplay: flex属性是如何工作的,但我找不到一种方法来完成我的尝试:像 Pinterest 这样的照片/作品集画廊,只使用 flexbox。

* {
    padding: 0;
    margin: 0;
}
body {
    background-color: #f1f1f1;
}
.Portifolio-container {
    width: 1200px;
    margin: 0 auto 20px;
    display: flex;
    align-items: flex-start;
    flex-basis: 10;
    justify-content: center;
    flex-flow: row wrap;
}
.Portifolio-image {
    width: 300px;
    height: auto;
    margin: 0;
    margin-left: 20px;
    margin-right: 20px;
}
.imagem {
    width: 296px;
    max-height: auto;
    background-color: white;
    margin-bottom: 0px;
    display: block;
    border: 2px solid #e4e4e4;
}
.portifolio-name {
    background-color: white;
    margin-top: 0px;
    height: 100px;
    border: 2px …
Run Code Online (Sandbox Code Playgroud)

html css flexbox

3
推荐指数
1
解决办法
1464
查看次数

标签 统计

css ×1

flexbox ×1

html ×1