本文介绍了CSS溢出问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用 overflow:hidden 来控制结束浮动。





我知道结束 float 有几种不同的方法,但 overflow trick通常效果最好。



但这次我不能正确使用。



如果您查看以下页面并尝试调整音量,您会看到音量控制在我的标题下。



p>

问题出现在#content-container div / p>

当我删除 overflow 音量控制超过了我的标题(这是我想要的) >

但我不能只是放弃 overflow 或者我必须得到另一个解决方案来控制浮动,这不是



任何人都有解决这个问题的方法?

解决方案

您可以给予代码片段 div clear:both 。你有元素在那里,无论如何,我认为你不会希望它包裹导航,所以它不只是添加无意的元素/类为它的脚。


I use overflow: hidden on my site to get control over ending floats.

Which up to now always have worked perfectly.

I know there are several different approaches of ending floats but the overflow trick normally works best.

However this time I cannot get it right.

If you look at the following page and try to adjust the volume you'll see that the volume control goes under my header.

http://pieterhordijk.com/sandbox/html5-audio-api/mp3-format

The problem is in the #content-container div

When I remove the overflow the volume control goes over my header (which is what I want).

But I can't just drop the overflow or I have to result to another solution to control the floats, which is not something I want to do unless REALLY necessary.

Anybody has a solution to this problem?

解决方案

You could give the snippets div clear:both. You have the element in there anyway, and I assume you wouldn't want it to wrap around the nav, so it's not just adding unsemantic elements/classes for the heck of it.

这篇关于CSS溢出问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 00:54