Adsense遇到的问题

1.为了解决页面CLS的issue,我给adsense的parent container设置了一个min-height,结果console报错:No slot size for availableWidth=0

            <q-item
              v-if="$q.platform.is.mobile"
              class="adsenseunitdetail q-pa-xs"
              style="min-height: 329px !important"
            >
              <!-- in-article-aquare2 -->
              <ins
                class="adsbygoogle"
                style="display: block"
                data-ad-client="ca-pub-3935005489954231"
                data-ad-slot="6650477400"
                data-ad-format="auto"
                data-full-width-responsive="true"
              ></ins>
            </q-item>
  • The parent container has no width set. If you place your responsive ad code within a parent container that doesn’t have an explicit width set, for example, within a floating element, then our ad code won’t be able to calculate the required size for the responsive ad unit. In this case, you’ll need to modify your code and use CSS media queries to set the size of the parent container. Find out how to modify your responsive ad code.
  • The parent container has fixed or limited height. Responsive ads should not be placed inside containers with a fixed or limited height, as they may be taller on some devices or browsers. If you need to limit the height of your responsive ads,  you’ll need to modify your code and use CSS media queries to set the height of the parent container. Find out how to modify your responsive ad code.

是响应式广告的问题。

posted @ 2024-01-14 03:47  zjhgx  阅读(67)  评论(0编辑  收藏  举报