Hi there,
how is the clearfix class working? I Update the zen version and reconized that the "clear block" was gone, instead there was a clearfix..
But this seems not working for me in IE 7... only after I put the "clear block" in code, the layout was working.
What have I to do, to make "clearfix " working? I can't find it in the zen css files..

Cheers

Comments

dboulet’s picture

Title: clearfix question » clearfix not working in ie7
Status: Active » Needs review
StatusFileSize
new562 bytes

I'm seeing the same problem. It seems that the problem was introduced when #445830: Rename clear-block CSS class to clearfix was committed.

This patch fixed the problem for me, taken from http://www.webtoolkit.info/css-clearfix.html.

n8tron’s picture

I'm using Zen 6.x-2.0-beta1, but I see .clearfix in page.css with some documentation.

/*
 * Markup free clearing (See: http://www.positioniseverything.net/easyclearing.html )
 */
.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
dboulet’s picture

@_natron The problem is that IE7 doesn't recognize the :after pseudoclass, and so it ignores this rule.

n8tron’s picture

ah. right.

alphex’s picture

Just noting, that the patch in post #1 fixed the issue for me.

konfuzed’s picture

Whoa this patch saved me from pulling more hair out ;) thanks!

dboulet’s picture

StatusFileSize
new564 bytes

Last patch had some tabbed indents that were bugging me.

Anonymous’s picture

This works is great, but surely should go in ie.css (seems to work fine there, too).

KrisBulman’s picture

thanks for the patch, agreed it should be in ie.css

KrisBulman’s picture

I notice that this duplicate: http://drupal.org/node/721264 is marked as fixed.. which should rely on this patch being included in dev. Has it been?

wattzy’s picture

The best way to use a clearfix can be found at best clearfix ever. It doesn't use class names to fix the problem but an automatic solution that should be applied to all block level elements except for the p and footer elements.

dboulet’s picture

StatusFileSize
new428 bytes

Simpler patch.

SweeneyTodd’s picture

Status: Needs review » Reviewed & tested by the community

The patch in comment #7 works in both IE 6 and 7.

Tested on Zen 6.x-2.0 as well.

jix_’s picture

Just FYI, D7 comes with the following clearfix (in system.css) which has fixes for IE6 and 7:

/**
 * Markup free clearing
 * Details: http://perishablepress.com/press/2009/12/06/new-clearfix-hack
 */
.clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}
/* IE6 */
* html .clearfix {
  height: 1%;
}
/* IE7 */
*:first-child + html .clearfix {
  min-height: 1%;
}

Thought you might want to consider this :)

kmonty’s picture

I'd like to second the suggestion we use D7's method, as suggest in comment #14

aleclerc’s picture

subscribing

MC_McMic’s picture

I have tried nearly all of these patches in the ie.css file, and none of them seem to be fixing the problem I'm having with my footer. I can't figure out what I'm doing wrong. Any suggestions?

dboulet’s picture

@MC_McMic, try adding the code from #14 to your stylesheet. If that doesn't fix your problem, then it might not be caused by this issue, or perhaps the CSS is not loading correctly.

SweeneyTodd’s picture

@MC_McMic - are you using css optimiser or the agregator or some other method of getting over the IE number of style sheet problem?

Are you making sure that the changes you make to the css are being copied through to the css that is being used? These modules compress the css into a single sheet in the site/mysite/files folder and you need to go to the theme page and save the Zen config and then clear the cache to make sure the new css is picked up.

MC_McMic’s picture

Wow, sorry it took me so long to reply. Every time I came into the forums section of the Drupal.org site, it would log me out... very strange. I had to restart to fix it.

Anyway, I did get the clearfix to work in IE7, but only by applying the suggested changes to the pages.css file... not the ie.css file.

I was being careful to clear the cache, and I do not have any of the performance optimizations turned on yet.

zincdesign’s picture

Copying and pasting the code from #14 works perfectly.

rjl’s picture

Ditto on the code from #14. It fixed the issue with IE7 for me.

dboulet’s picture

Version: 6.x-1.1 » 6.x-2.x-dev
Category: task » bug
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.04 KB

No need to pollute our CSS files with hacks as in #14, we have ie-specific stylesheets.

barraponto’s picture

seems fine, but i don't have ie to test...

johnalbin’s picture

Component: CSS/HTML Markup » layout.css
Category: bug » support
Status: Needs review » Postponed (maintainer needs more info)

The current clearfix class works fine in IE.

Are you all experiencing the 31 stylesheet limitation of IE? Try turning on CSS aggregation and see if you still have issues with Zen's clearfix class.

@dboulet The lines you are replacing in the ie.css and ie6.css already fix the clearfix class for IE6 and IE7. That's what "zoom: 1" does. Its an IE-only rule that turns on the element's haslayout property. http://www.satzansatz.de/cssd/onhavinglayout.html

johnalbin’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)