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

Body isn't taking cover of the whole screen

In my css:

body {
    background-color: black;
    color: white;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    padding: 0;
    /* animation: scroll 5s; */
}

After this code in the body tag, the body is still not taking up the whole screen in browser, in inspect it shows that it has 1536 * 417 dimension, even when my screen size is 1920*1080

I tried using 100vh height, but made it worse by messing up the posotion relative elements.

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 :

Do you have any UI frameworks or other CSS imported into your site that might be doing some funny stuff to it?

Without knowing what your end goal is and why you want to cover the whole screen body { height: 100vh; } or this should work:

html {
  height: 100%;
}
body {
  min-height: 100%;
}

Also make sure you have zoomed your browser window too 100%. CTRL+0 on Windows.

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