How to set the iframe height & width to 100%?

by cali_green , in category: HTML & CSS , 4 months ago

How to set the iframe height & width to 100%?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by mac , 4 months ago

@cali_green 

To set the height and width of an iframe to 100%, you can use the following CSS code:

1
2
3
4
iframe {
    width: 100%;
    height: 100%;
}


You can add this CSS code directly to your HTML file within a <style> tag or in an external CSS file. This code will make the iframe fill the entire width and height of its container.