【问题标题】:Images not aligning up图像未对齐
【发布时间】:2021-09-27 10:33:34
【问题描述】:

每当我尝试排列我的图像时,我都会遇到一个问题。好像没有排队。 我不知道这是否是图像问题,但我可以使用一些帮助。 我是新手,所以如果这对我来说很容易解决,我深表歉意。

.portfolio-item-wrapper2 {
    display: flex;
    grid-template-columns: 1fr 1fr 1fr;

}

.portfolio-item-wrapper2 {
    position: relative;

}

.portfolio-img-background2 {
    height: 350px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.img-text-wrapper2 {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding-left: 100px;
    padding-right: 100px;
}
<div class="content=wrapper2">
    <div class="portfolio-items-wrapper2">
        <div class="portfolio-item-wrapper2">
            <div class="portfolio-img-background2">
                <div class="img-text-wrapper2">
                    <div class="logo-wrapper2">
                        <img src="\\kcfs04\StudentHome\20023600\Downloads\C.png" />

                    </div>
                </div>

            </div>
        </div>
    </div>

</div>

<div class="content=wrapper3">
    <div class="portfolio-items-wrapper3">
        <div class="portfolio-item-wrapper3">
            <div class="portfolio-img-background3">
                <div class="img-text-wrapper3">
                    <div class="logo-wrapper3">
                        <img src="\\kcfs04\StudentHome\20023600\Downloads\G.png" />

                    </div>
                </div>

            </div>
        </div>
    </div>

</div>

这是问题:

我需要它们并排放置,因为我将在下面添加更多内容,但位置相同。

【问题讨论】:

    标签: html css image visual-studio-code


    【解决方案1】:

    首先,不要同时使用css grid和flexbox,你可以使用位置相关属性

    【讨论】:

      猜你喜欢
      • 2014-03-03
      • 2011-06-26
      • 2012-01-30
      • 2019-05-20
      • 2012-10-12
      • 2023-03-12
      • 2017-11-03
      • 2016-10-26
      • 2016-11-03
      相关资源
      最近更新 更多