可变大小的浮动 div
我有 3 个 div 都向左浮动。我想将第二个 div 和第三个 div 设置为特定大小(基于像素或百分比),而第一个 div 仅占用其余空间。
此外,在运行时,根据用户的权限,可能不会显示特定大小的 div 之一。我需要第一个 div 来占据剩余的空间。
我该怎么做?
I have 3 divs all floated left. I want to set the second div and third div to specific sizes (based on pixels or percentages) and the first div to simply take up the rest of the space.
Additionally at runtime depending on the user's privileges one of the specific sized divs might not be displayed. I need the first div to take up the space left over.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 display:table 属性,例如:
http://jsfiddle.net/WVDNe/8/
它在 IE7 和 IE7 中不起作用。以下。
但检查一下它是否适用于所有浏览器:
http://jsfiddle.net/LJGWY/3/
You can use display:table property for like :
http://jsfiddle.net/WVDNe/8/
It's not work in IE7 & below.
But check this it's work in all browsers:
http://jsfiddle.net/LJGWY/3/