Page 1 of 1

Responsive Iframe Css Tricks

Posted: Sat Jan 13, 2018 8:59 am
by arnlweb
How to make your Iframe code responsive?

Code: Select all

<iframe class="button-api-frame" id="myframe" src="//" width="100%" height="100%" allowtransparency="true" scrolling="no" style="border:none"></iframe>
Add Css ID "myframe":

Code: Select all

<style>@media screen and (min-width: 651px) {#myframe{height:100px!important;}}@media (min-width: 400px) and (max-width: 650px) {#myframe{height:200px!important;}}@media (min-width: 200px) and (max-width: 399px) {#myframe{height:300px!important;}}