火狐浏览器的CSS怪异 - 浮动左侧不会左浮动,除非使用大宽度 [英] CSS weirdness in firefox - float left not floating left, unless large width is used

查看:1037
本文介绍了火狐浏览器的CSS怪异 - 浮动左侧不会左浮动,除非使用大宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题

$ p $ #column-left {
float:left;
width:350px;
}

将向左浮动,但当宽度变小时



用这个:
#column-left {
float:left;
width:250px;
}



不起作用。这两个表单工作在铬,但不是在Firefox。任何想法?



下面是一些图像来说明: http: //imgur.com/a/v0uIZ

解决方案

更新您的CSS代码,如下所示。


$ b

删除 float:left; 和 width:350px; from #column-left



添加 position:absolute; #column-left



更改 margin-left:220px; / code>在 #content



这样做会有所帮助。在Firefox和谷歌浏览器上测试过。


I have a problem

 #column-left {
     float: left;
     width: 350px;
 }

will float left, but when I make the width smaller

with this: #column-left { float: left; width: 250px; }

it doesn't work. Both forms work in chrome, but not in firefox. Any ideas?

Here are some images to illustrate: http://imgur.com/a/v0uIZ

解决方案

Update your CSS code as below.

Remove float: left; and width: 350px; from #column-left.

Add position: absolute; to #column-left

Change margin-left: 220px; on #content

This will do the magic. Tested on Firefox and Google Chrome.

这篇关于火狐浏览器的CSS怪异 - 浮动左侧不会左浮动,除非使用大宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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