On August 21, 2019, we made some improvements to responsive ad unit sizing to allow for better performance on desktop. We also increased the flexibility of responsive ad units by enabling additional size combinations for all device types.
As a result of these changes, responsive ad units can now resize the HTML parent container (e.g., <div>
) that they're within. This allows them to automatically adapt to all the different ad sizes on publishers' pages.
Note that for responsive ad units to work properly, they must not be placed inside a container with a fixed or limited height. (See our technical considerations for more details.) If you're experiencing issues with your responsive ad units appearing taller on some devices or browsers, it might be because they're within a container with a fixed or limited height.
If you want to limit the height of your responsive ads, you'll need to modify your responsive ad code. This example shows you how to modify your responsive ad code to specify a fixed height of 90px and a variable width from min-width 400px to max-width 970px:
<ins class="adsbygoogle"
style="display:inline-block;min-width:400px;max-width:970px;width:100%;height:90px"
data-ad-client="ignored1234"
data-ad-slot="5678"></ins>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ignored1234" crossorigin="anonymous"></script>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
For more examples and other advanced implementations, see how to modify your responsive ad code.