为什么我设置为100%宽度的div不希望在页面滚动时伸展到浏览器窗口的宽度? [英] Why my div that is set to 100% in width doesn't want stretch to the width of the browser window when the page is scrolled?

查看:79
本文介绍了为什么我设置为100%宽度的div不希望在页面滚动时伸展到浏览器窗口的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我的div设置为100%的宽度并不希望当页面滚动时伸展到浏览器窗口的宽度? 解析方案根据我的理解,与表格相比,Div标签不能很好地将它们伸展到100%的宽度或高度。注意几乎所有的微软代码都使用表格作为基础。我想如果你把div放在一个宽度正确的表格单元格中,然后做宽度:100%; , 这应该够了吧。如果你可以..有你的母版页基于一个可拉伸的表。



希望这不会太远离你想要的。


Why my div that is set to 100% in width doesn't want stretch to the width of the browser window when the page is scrolled?

解决方案

As far as I understand it, Div tags are not very good at stretching themselves to 100% of the width or height in comparison to Tables. Notice how nearly all of Microsoft's code uses tables as a base. I think if you put the div inside a table cell which has the correct width and then do width:100%; , that should do the trick. If you can.. have your master page based on a stretchable table.

Hope this isn't too far off what you're looking for.

这篇关于为什么我设置为100%宽度的div不希望在页面滚动时伸展到浏览器窗口的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆