1

We have a site that has a responsive google ad on top of the content. On desktop it shows a long horisontal rectangle ad which is perfect.

On mobile it shows a large rectangle which is not good as it takes most of the screen. Is there any way to restrict the container of the ad for example to max height of 250px. That way the ad will not be large rectangle on mobile?

Thanks

1

2 Answers 2

1

Use a media query to test for smaller devices

then add a max height to your element

Replace the [.google-addword-class] below with the class that google adwords uses.

@media only screen and (max-width: 600px) {
    [.google-addword-class] {
        max-height: 200px !important;
    }
}
1

The max-height: attribute should suffice I believe. You can read more about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.