Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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;

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading