Home  >  Article  >  Web Front-end  >  width:100%,也不能让DIV占满整个屏幕_html/css_WEB-ITnose

width:100%,也不能让DIV占满整个屏幕_html/css_WEB-ITnose

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

 有上,中,下3个div,如何让其占满屏幕?

 <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>


回复讨论(解决方案)

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

div的容器是否是占了页面的100%?用 body 的padding:0看看先。你的页面布局是怎么样的,最好发个图上来。

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