CSS修改以实现横幅正确对齐

嘿,各位。有人能帮我修改 CSS 吗?

我是这方面的新手,不知道该怎么办。

我严格按照说明(https://meta.discourse.org/t/house-ad-templates/122004)制作了我的第一个横幅。但是,横幅没有居中显示在页面上,并且离标题太近了(见截图)。

我希望在横幅和标题之间至少有 10px 的间距。

有人能指导我修改代码以消除这两个缺陷吗?

    .banner-ad {
        display: flex;
        clear: both;
        max-width: calc(#{$topic-body-width} + #{$topic-avatar-width} + (#{$topic-body-width-padding} * 2));
        box-sizing: border-box;
        img {
            height: 100%;
            &.desktop {
                display: block;
            }
            &.mobile {
                display: none;
            }
        }
    }

    @media only screen and (max-width: 672px) {
        .banner-ad {
            img.desktop, p {
                display: none;
            }
            img.mobile {
                display: block;
            }
        }
    }

banner-ad 中,您可以添加:

place-self: center;
margin: 1em 0;

3 个赞

非常感谢!

1 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.