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

WBOY
Release: 2016-06-24 11:41:30
Original
1952 people have browsed it

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>
Copy after login


Reply to discussion (solution)

html,body{margin:0;pading:0;}
Copy after login

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.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template