CSS浮动侧窗格调整主要内容的大小 [英] CSS float bug with side pane resizing main content

查看:128
本文介绍了CSS浮动侧窗格调整主要内容的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们遇到了一个悬浮在右侧的侧窗格的问题。此窗格会以某种方式调整主要内容中的第一个div,因此div会延伸到与窗格相同的高度,如下图所示。



主div具有以下css

  margin:10px 280px 0 10px; 
padding-right:50px;

侧窗格具有以下css

  float:right; 
width:270px;
margin:10px 10px 0 0;

会发生什么?



解决方案

尝试将 overflow:auto 添加到主 div


We're having a problem with a side pane that is floated to the right. This pane somehow resizes the first div in the main content, so the div is stretched to the same height as the pane, see illustration below.

The main div has the following css

margin: 10px 280px 0 10px;
padding-right: 50px;

The side pane has the following css

float: right;
width: 270px;
margin: 10px 10px 0 0;

What would make this happen? How can I fix it?

This error occurs in Firefox 3.6

解决方案

Try adding overflow:auto to main div.

这篇关于CSS浮动侧窗格调整主要内容的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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