Set max height of Adsense responsive ad unit

You could change data-ad-format="auto" to data-ad-format="rectangle". (See Advanced features > Horizontal shape example.)

I think you should not define height (max-height) on parent div.

Ad height is (automatically) determined by adsbygoogle.js (that is smart sizing) and if you want to control ad height you need to use data-ad-format ("rectangle", "vertical", "horizontal" or your preferred combination like "rectangle,horizontal").

Or (not recommended) you could "downgrade" the ad code (by removing data-ad-format attribute) and then specify the exact size(s) with @media queries. (See Exact size example.)


EDIT - Google updated "Technical considerations" section on "About responsive ad units" page.

There are some situations in which you’ll need to take extra action to make a responsive ad unit work correctly:

...

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 unit.


I've just managed to fix this - you can set a comma seperated list for data-ad-format.

data-ad-format="rectangle, horizontal"

This sets the mobile ad to horizontal and the desktop to rectangle if you have set your media queries specific sizes.

Thanks, Wesiwyg