Archived topic
Show different banners on mobile CSS
3 replies · Started by Jeroen on January 19, 2022
Hello guys,
It has been a while.... Hope to find you all in good health.
On one of our domains called bettinggroups.com we just added some i-frame banners. All looking great. Except we would love to show a different size and style on mobile divices.
Sow how to have 2 i-frames on the page.. one olny showing on desktop.. The other only showing on mobile. Could we CSS this?
Example:
Mobile:
<iframe scrolling='no' frameBorder='0' style='padding:0px; margin:0px; border:0px;border-style:none;border-style:none;' width='300' height='250' src="" ></iframe>
Desktop:
<iframe scrolling='no' frameBorder='0' style='padding:0px; margin:0px; border:0px;border-style:none;border-style:none;' width='970' height='250' src="" ></iframe>
Hi there,
GP has hide-on-* classes you can add to your iframe HTML - see here:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes
Works perfect and super easy!!! Thanks David
Glad to be of help