# 更改帖间广告的高度？

**URL:** <https://meta.discourse.org/t/changing-the-height-of-between-post-ads/163759>\
**Category:** Support\
**Tags:** advertising\
**Created:** [2020年九月11日 17:56 UTC](https://meta.discourse.org/t/changing-the-height-of-between-post-ads/163759 "2020-09-11T17:56:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank2/32/182121_2.png) [@Frank2](https://meta.discourse.org/u/Frank2)\
**Post date:** [2020年九月11日 17:56 UTC](https://meta.discourse.org/t/changing-the-height-of-between-post-ads/163759/1 "2020-09-11T17:56:15Z")

</div>

你好，我正在使用自家广告，但比例非常奇怪。

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/3/d3f7fe5881e7bb6e07e3ae741ed3bccd363de8b8.jpeg)

我尝试通过编辑 CSS 来调整：

```plaintext
    .house-creative.house-post-bottom {
    a.between-posts-ad {
        max-height: 1672px;
        img {
        &.desktop {
            height: 172px;
            display: block;
        }
        &.mobile {
            height: 172px;
            display: none;
        }   
        }
    }
    }

```

我的广告 HTML 代码如下：（我知道如何正确闭合标签，这里特意去掉了 ‘\>’ 以便在此处显示代码）

```plaintext
<
a href="xxxx" class="banner-ad" target="_blank">
    img class="desktop" src="xxx" style="xxxx" height="172" width="172">
    img class="mobile" src="xxx" style="xxxx" height="172" width="172">
</a>

```

如您所见，这导致宽度为 172px，这正是我想要的，但高度并不是我设置的值。

有人能帮忙解释一下问题出在哪里吗？

---

<div class="post-metadata">

**Author:** ![Bcat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bcat/32/163148_2.png) [@Bcat](https://meta.discourse.org/u/Bcat)\
**Post date:** [2020年九月12日 05:01 UTC](https://meta.discourse.org/t/changing-the-height-of-between-post-ads/163759/2 "2020-09-12T05:01:16Z")

</div>

如果您能提供包含广告模板的网站，将会更容易。
