I was developing a page recently, and after finding that everything worked properly noticed that I hadn't added the <!doctype html>
tag at the top. Upon adding it, the layout ignored the height.
I stripped it down to the most basic layout to see what was wrong and the problem persists. Is what I'm doing inconsistent with HTML5?
The working source code
What it looks like
You should add the code to your post or it will get closed. Also, something on codepen or jsfiddle would work better, so that we can actually see the results, rather than pastebin.
Add this to your CSS:
html, body {
height: 100%;
min-height: 100%; /* for firefox */
}
You have to set the height of your tag
body, html {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With