Home > Net >  How can I make the html content to occupy the entire browser window?
How can I make the html content to occupy the entire browser window?

Time:12-15

I have the below div in a html page which tries to render content from a different html page. The rendered html content occupies the entire width but not the height. what needs to be changed in the style attribute to occupy the entire height available?

Thank you!

<div>
    <embed type="text/html" style="text-align:center;width:100%;height:100%"
       src="https://app.mytest.com/common/mydocuments.html">
</div>

CodePudding user response:

Well, there are a lot of methods to achieve this in CSS, but the approach I love to use to achieve this is using full viewport height and width.

embed {
  height: 100vh;
  width: 100vw;
}

it basically tells the browser to use the entire window for this tag.

and to make it fix you can use position: fixed;

  • Related