Home >Web Front-end >HTML Tutorial >width:100%, you can't let the DIV occupy the entire screen_html/css_WEB-ITnose

width:100%, you can't let the DIV occupy the entire screen_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:41:301978browse

There are three divs: top, middle and bottom. How to make them fill the screen?

 <div style="width:100%;background:#ffffff;height:100px;border:0;padding:0;margin:0;text-decoration:none;"></div> <div style="width:100%;background:red;height:100px;border:0;padding:0;margin:0;text-decoration:none;"></div>  <div style="width:100%;background:yellow;height:100px;border:0;padding:0;margin:0;text-decoration:none;"></div>


Reply to discussion (solution)

html,body{margin:0;pading:0;}

Whether the div container occupies the page 100%? Use body 's padding: 0 to see first. What is the layout of your page? It's best to send a picture.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn