的Jsfiddle
http://jsfiddle.net/CSS_Apprentice/ru8f6/
HTML
<div > <div ID="header"></div> <div ID="content"> <div ID="Box1"></div> <div ID="Box2"></div> <div ID="Box3"></div> <div ID="Box4"></div> <span ></span> </div> <div ID="footer"></div></div>
CSS
.container { wIDth: 100%; height: 100%; border: 1px solID black;}#header { border: 1px solID black; wIDth: 100%; height: 50px;}#content { border: 2px solID #444; height: 125px; text-align: justify; -ms-text-justify: distribute-all-lines; text-justify: distribute-all-lines; padding-right: 25px; padding-left: 25px;}#content > div { border: 1px dashed black; wIDth: 100px; height: 100px; vertical-align: top; display: inline-block; *display: inline; zoom: 1;}.stretch { wIDth: 100%; display: inline-block; Font-size: 0; line-height: 0;}#footer { border: 1px solID black; wIDth: 100%; height: 50px;}
我正在使用“Justify Text”技巧来调整我的div,但我怀疑这是导致问题的原因.这不是一个大问题,但它只是让我烦恼:)
解决方法 因为浏览器的默认样式表.默认情况下,HTML body标签的边距为8 px.有关浏览器默认样式表的列表,请参阅 here.和 here对于W3C的想法.要“修复”这个,给它一个余量:0;
body { margin: 0;}总结
以上是内存溢出为你收集整理的HTML – 为什么我的内容宽度小于100%?全部内容,希望文章能够帮你解决HTML – 为什么我的内容宽度小于100%?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)