Alex Rivera | Logout

Adding doctype html breaks layout height

Asked 2013-06-26T19:00:30.837
8

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

Edit
Report

1 Answer

2

You have to set the height of your tag

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}
answered 2013-06-26T19:05:12.380

Your Answer