本文介绍了为什么这么清楚:两者都是全球性的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



据我所知,清除浮动大多在父项目上工作。但在我的模板中有一个问题在post缩略图后,其中 code>到父元素。



EDIT



奖金。如果你想使用一些奇特的CSS3东西(如dropshadows),上面的黑客将失败。



有一个新的黑客:



虽然这个黑客也有一些问题。



这需要一些时间,才能使一些严肃的使用CSS3



您可以使用它,但浏览器支持长时间后会很差:)


Issue

As far as I know clearing floats mostly works on parent items. But there is one issue in my template after the post thumbnail, where the clear: both acts on the whole content wrapper. Without clearing the float, the thin line will stick to the text right to the thumbnail.

What I want to do is to have the line 45px below either the thumbnail or the text (depending on what height is higher).

Preview

Please have a look at this sample.

Any help would be highly appreciated!

解决方案

Just use the overflow: hidden; hack to end floats.

Add the CSS overflow: hidden to the parent element.

EDIT

As a bonus. If you want to use some fancy CSS3 stuff (like dropshadows) the above hack will fail.

There is a new hack: http://fordinteractive.com/2009/12/goodbye-overflow-clearing-hack/

Although this hack also has some issues.

And it would take some time before you can make some serious use of fancy CSS3 stuff.

You could use it, but the browser support will be poor for a long time :)

这篇关于为什么这么清楚:两者都是全球性的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-16 02:46