The clear fix 10.08.2008 @ 06:51pm 73 comments

If you often create layouts with XHTML & CSS and end up appending the <br style="clear: both;" /> or <div class="clear"></div> 'fix' to your markup when a containing element does not wrap it's floated children, then now is the time to stop! There is a much more efficient way to acheive this with CSS alone.

Whenever you come across this problem (in modern browsers excluding IE) you can resolve it by simply applying the following to the wrapper element:

#wrapper:after {
    content: ".";
    clear: both;
    display: block;
    height: 0;
    visibility: hidden;
    }

I tend to add a .clear class that contains this block of code which you can then apply to any wrapper that requires it. However, for static elements (that are unlikely to change very often) like #header, #navigation and #footer, I just chain them on to the selector.

.clear:after,
#header:after,
#navigation:after,
#footer:after {
    content: ".";
    clear: both;
    display: block;
    height: 0;
    visibility: hidden;
    }

Now I don't want to see anymore uneccessary <div>'s or <br />'s ;)

What people think...

There have been 73 comment(s) on this entry so far. Have something you'd like to say? Feel free to comment below.

Pham Can said...
10.03.2010 @ 08:17am

Great info! However many links are not working!

Gen f20 Scam said...
10.03.2010 @ 01:01am

hi, this is nice info, infact f9 tips. Thanks for sharing. Keep it up.

emamafox said...
08.03.2010 @ 11:45am

http://fabuzo.co.cc http://guqamepu.strefa.pl http://www.lastfm.ru/user/cumavoje/journal
скачать долгое порно видео
http://gimimola.freehostia.com http://podega.freehostingz.com http://gaguvamo.freehostia.com
халявное 3gp поррно
Download best sex here

emamafox said...
08.03.2010 @ 11:45am

http://fabuzo.co.cc http://guqamepu.strefa.pl http://www.lastfm.ru/user/cumavoje/journal
скачать долгое порно видео
http://gimimola.freehostia.com http://podega.freehostingz.com http://gaguvamo.freehostia.com
халявное 3gp поррно
Download best sex here

Giles D said...
07.03.2010 @ 11:56pm

Which I used this tip years ago, CSS can be a pain at times!

pack said...
05.03.2010 @ 05:49am

great tip.. thanks

Tech Guy said...
02.03.2010 @ 10:11pm


is horrible practice

Hiking said...
24.02.2010 @ 08:54pm

Thanks, great info!

Amethyst said...
22.02.2010 @ 11:18am

Good tip, thanks for the heads up

Luigi Games said...
18.02.2010 @ 05:22am

Nice info!

Free Beats said...
15.02.2010 @ 07:12pm

thanks for this, it worked out for my site

Hgn said...
13.02.2010 @ 06:21pm

will work thx

Jane said...
12.02.2010 @ 10:20pm

I will definitely use it in my projects. Thank you for the article.

Ca Foreclosures said...
29.01.2010 @ 12:25pm

thanks nice info

يوتيوب said...
27.01.2010 @ 06:22pm

thankxx

مزيكها على كيفك said...
26.01.2010 @ 07:34pm

thankxx

mobil said...
26.01.2010 @ 08:27am

Thanks you very much, i have been looking for this for a while now. superb!!

Adwords Consultant said...
06.01.2010 @ 03:37pm

this will be great!

mike said...
06.01.2010 @ 03:36pm

nice, this will be very useful.

iphone fix said...
04.01.2010 @ 11:17pm

I am currently begging even testing the CSS, and I think it will help me a lot!

I can learn a lot from you

webmatrix said...
02.01.2010 @ 12:48am

This post is very important for me because here we can learn more about all.
Thank for this great tips I'll be just tring to do......

Male Celebrities Pictures said...
21.12.2009 @ 11:05am

Nice blog..thanks for the info..

iCelebsDB.com - The Biggest Male Celebrity Online Resource said...
21.12.2009 @ 11:02am

Thanks for the knowledge sharing...

watch movie online free said...
17.12.2009 @ 03:26pm

Ah thanks for this, had exactly this problem.

Dorian said...
08.12.2009 @ 01:57pm

Great use of :after! If this, haslayout and height: 1% can replace my redundant divs I'll be megahappy.

Predictive Dialer System said...
06.12.2009 @ 11:26pm

Wow this actually works. I passed it on to my web designer... I'm still learning how to do CSS and your articles are fantastic for newbies. Really appreciate you sharing!

MoopInnorie said...
30.11.2009 @ 11:02pm

Hey!
How ar you?
I got her video today i'm sure you'll enjoy

Taylor Swift,Taylor Swift nude,Taylor Swift naked,Taylor Swift pictures,Taylor Swift lyrics,Taylor Swift love story,Taylor Swift love story lyrics,Taylor Swift fearless,Taylor Swift tickets
Click Here:Taylor Swift naked
Click Here:Taylor Swift nude Video
Click Here:Taylor Swift Nude Sex Video
Click Here:Taylor Swift nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Taylor Swift Picrures
Click Here:Taylor Swift naked
Click Here:Taylor Swift Naked
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift pictures
Click Here:Taylor Swift Video
Click Here:Taylor Swift Sex
Click Here:Taylor Swift nude

Abi Titmuss,Abi Titmuss Nude,Abi Titmuss Sex Tape,Abi Titmuss Naked,Abi Titmuss Sex,Abi Titmuss Sex Video,Abi Titmuss Video,Abi Titmuss Porn,Abi Titmuss Pictures
Click Here:Abi Titmuss Sex Tape
Click Here:Abi Titmuss Nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Naked
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude Naked
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude

Sarah Michelle Gellar,Sarah Michelle Gellar Nude,Sarah Michelle Gellar Naked,Sarah Michelle Gellar Fakes,Sarah Michelle Gellar Pussy,Sarah Michelle Gellar Sexy
Click Here:Abi Titmuss Sex Tape
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Fakes
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude Naked
Click Here:Sarah Michelle Gellar Nude Sex
Click Here:Sarah Michelle Gellar Nude Sex Tape
Click Here:Sarah Michelle Gellar Nude Video
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude

MoopInnorie said...
30.11.2009 @ 11:02pm

Hey!
How ar you?
I got her video today i'm sure you'll enjoy

Taylor Swift,Taylor Swift nude,Taylor Swift naked,Taylor Swift pictures,Taylor Swift lyrics,Taylor Swift love story,Taylor Swift love story lyrics,Taylor Swift fearless,Taylor Swift tickets
Click Here:Taylor Swift naked
Click Here:Taylor Swift nude Video
Click Here:Taylor Swift Nude Sex Video
Click Here:Taylor Swift nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Taylor Swift Picrures
Click Here:Taylor Swift naked
Click Here:Taylor Swift Naked
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift pictures
Click Here:Taylor Swift Video
Click Here:Taylor Swift Sex
Click Here:Taylor Swift nude

Abi Titmuss,Abi Titmuss Nude,Abi Titmuss Sex Tape,Abi Titmuss Naked,Abi Titmuss Sex,Abi Titmuss Sex Video,Abi Titmuss Video,Abi Titmuss Porn,Abi Titmuss Pictures
Click Here:Abi Titmuss Sex Tape
Click Here:Abi Titmuss Nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Naked
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude Naked
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude

Sarah Michelle Gellar,Sarah Michelle Gellar Nude,Sarah Michelle Gellar Naked,Sarah Michelle Gellar Fakes,Sarah Michelle Gellar Pussy,Sarah Michelle Gellar Sexy
Click Here:Abi Titmuss Sex Tape
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Fakes
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude Naked
Click Here:Sarah Michelle Gellar Nude Sex
Click Here:Sarah Michelle Gellar Nude Sex Tape
Click Here:Sarah Michelle Gellar Nude Video
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude

MoopInnorie said...
30.11.2009 @ 11:02pm

Hey!
How ar you?
I got her video today i'm sure you'll enjoy

Taylor Swift,Taylor Swift nude,Taylor Swift naked,Taylor Swift pictures,Taylor Swift lyrics,Taylor Swift love story,Taylor Swift love story lyrics,Taylor Swift fearless,Taylor Swift tickets
Click Here:Taylor Swift naked
Click Here:Taylor Swift nude Video
Click Here:Taylor Swift Nude Sex Video
Click Here:Taylor Swift nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Taylor Swift Picrures
Click Here:Taylor Swift naked
Click Here:Taylor Swift Naked
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift pictures
Click Here:Taylor Swift Video
Click Here:Taylor Swift Sex
Click Here:Taylor Swift nude

Abi Titmuss,Abi Titmuss Nude,Abi Titmuss Sex Tape,Abi Titmuss Naked,Abi Titmuss Sex,Abi Titmuss Sex Video,Abi Titmuss Video,Abi Titmuss Porn,Abi Titmuss Pictures
Click Here:Abi Titmuss Sex Tape
Click Here:Abi Titmuss Nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Naked
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude Naked
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude

Sarah Michelle Gellar,Sarah Michelle Gellar Nude,Sarah Michelle Gellar Naked,Sarah Michelle Gellar Fakes,Sarah Michelle Gellar Pussy,Sarah Michelle Gellar Sexy
Click Here:Abi Titmuss Sex Tape
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Fakes
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude Naked
Click Here:Sarah Michelle Gellar Nude Sex
Click Here:Sarah Michelle Gellar Nude Sex Tape
Click Here:Sarah Michelle Gellar Nude Video
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude

MoopInnorie said...
30.11.2009 @ 11:02pm

Hey!
How ar you?
I got her video today i'm sure you'll enjoy

Taylor Swift,Taylor Swift nude,Taylor Swift naked,Taylor Swift pictures,Taylor Swift lyrics,Taylor Swift love story,Taylor Swift love story lyrics,Taylor Swift fearless,Taylor Swift tickets
Click Here:Taylor Swift naked
Click Here:Taylor Swift nude Video
Click Here:Taylor Swift Nude Sex Video
Click Here:Taylor Swift nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Taylor Swift Picrures
Click Here:Taylor Swift naked
Click Here:Taylor Swift Naked
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift pictures
Click Here:Taylor Swift Video
Click Here:Taylor Swift Sex
Click Here:Taylor Swift nude

Abi Titmuss,Abi Titmuss Nude,Abi Titmuss Sex Tape,Abi Titmuss Naked,Abi Titmuss Sex,Abi Titmuss Sex Video,Abi Titmuss Video,Abi Titmuss Porn,Abi Titmuss Pictures
Click Here:Abi Titmuss Sex Tape
Click Here:Abi Titmuss Nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Naked
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude Naked
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude

Sarah Michelle Gellar,Sarah Michelle Gellar Nude,Sarah Michelle Gellar Naked,Sarah Michelle Gellar Fakes,Sarah Michelle Gellar Pussy,Sarah Michelle Gellar Sexy
Click Here:Abi Titmuss Sex Tape
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Fakes
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude Naked
Click Here:Sarah Michelle Gellar Nude Sex
Click Here:Sarah Michelle Gellar Nude Sex Tape
Click Here:Sarah Michelle Gellar Nude Video
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude

MoopInnorie said...
30.11.2009 @ 11:01pm

Hey!
How ar you?
I got her video today i'm sure you'll enjoy

Taylor Swift,Taylor Swift nude,Taylor Swift naked,Taylor Swift pictures,Taylor Swift lyrics,Taylor Swift love story,Taylor Swift love story lyrics,Taylor Swift fearless,Taylor Swift tickets
Click Here:Taylor Swift naked
Click Here:Taylor Swift nude Video
Click Here:Taylor Swift Nude Sex Video
Click Here:Taylor Swift nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Taylor Swift Picrures
Click Here:Taylor Swift naked
Click Here:Taylor Swift Naked
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift nude
Click Here:Taylor Swift pictures
Click Here:Taylor Swift Video
Click Here:Taylor Swift Sex
Click Here:Taylor Swift nude

Abi Titmuss,Abi Titmuss Nude,Abi Titmuss Sex Tape,Abi Titmuss Naked,Abi Titmuss Sex,Abi Titmuss Sex Video,Abi Titmuss Video,Abi Titmuss Porn,Abi Titmuss Pictures
Click Here:Abi Titmuss Sex Tape
Click Here:Abi Titmuss Nude
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Alina Percea Virginity Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Naked
Click Here:Abi Titmuss sex Tape
Click Here:Abi Titmuss Nude Naked
Click Here:Abi Titmuss Nude Video
Click Here:Abi Titmuss Nude
Click Here:Abi Titmuss Nude

Sarah Michelle Gellar,Sarah Michelle Gellar Nude,Sarah Michelle Gellar Naked,Sarah Michelle Gellar Fakes,Sarah Michelle Gellar Pussy,Sarah Michelle Gellar Sexy
Click Here:Abi Titmuss Sex Tape
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Fakes
Click Here:Sarah Michelle Gellar Naked
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude Naked
Click Here:Sarah Michelle Gellar Nude Sex
Click Here:Sarah Michelle Gellar Nude Sex Tape
Click Here:Sarah Michelle Gellar Nude Video
Click Here:Sarah Michelle Gellar
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude
Click Here:Sarah Michelle Gellar Nude

HCG Diet & Weight Loss said...
25.11.2009 @ 01:14pm

This is a good fix to a nagging issue. The .clear class has always been one of our favorites, so this an innovative use of it.

restaurantes madrid said...
23.11.2009 @ 12:09am

It's a Nice article! I like very so much. I think that the information presented should be useful to many people a lot.

Darba piedāvājumi said...
20.11.2009 @ 01:17pm

Currently I am at the very begging at CSS studies and I think that this will help me a lot!

I can learn a lot from you.

AYURVEDIC MEDICINE said...
17.11.2009 @ 05:56am

i like this information. too good jenna....

STICKERS PRINTING said...
17.11.2009 @ 05:54am

its really very great information i like your posting thanks for this.

MOTORCYCLE PARTS said...
17.11.2009 @ 05:52am

its really very fantastic posting its so informative thanks for sharing this with us.

THANKSGIVING MESSAGE said...
17.11.2009 @ 05:14am

THANKS FOR ALL COMMENTERS HERE.

San Diego Room Additions said...
10.11.2009 @ 03:03pm

That is great if you know css. I can only you it for text. Otherwise im lost. :)

Wool jersey fabrics said...
03.11.2009 @ 12:32pm

This is amazing but sounds weird... I am for div with clear on it but I'll test your invention. Nice tutorial!

Matt said...
03.11.2009 @ 05:17am

Ah thanks for this, had exactly this problem.

Adobe Flash Training said...
29.10.2009 @ 08:18pm

This CSS trick is definitively cleaner semantically speaking than using the usual "clear" div or line break.
As usual IE6 has problem with certain pseudo-selector and that kills CSS creativity sometimes. It will be over soon for sure.

Jen said...
26.10.2009 @ 10:17am

Anyone think we will ever be done with the

copper clad aluminium wire said...
19.10.2009 @ 06:13am

hi Jenna ,Tks for yr sharing . do you provide any open/free tutorial course somewhere for newbie ... ?

Windows 7 Codecs said...
16.10.2009 @ 07:56am

very useful post. you are the best! Well done

Manic said...
16.10.2009 @ 02:19am

It's a Nice article! I like very so much. I think that the information presented should be useful to many people a lot.

Web Design Malta said...
08.10.2009 @ 05:47am

A neat approach, however I'm going to stick with my clearfix-based solution, as it works in all browsers and I hate having to put IE-specific hacks into my CSS.

Entretien said...
07.10.2009 @ 09:26am

Thanks for the info Jenna :)

Johny Blaze said...
06.10.2009 @ 01:31pm

Nice fix..I was so sick of using that Clear hack every time I wanted the Div to wrap the floating text. This helps out a ton, thanks for it.

Johnny Blaze
Developer @ Halo E-Liquid Company

Poptropica said...
05.10.2009 @ 12:46am

I love little CSS efficiency tricks like this one.

Yahoo invisible detector said...
04.10.2009 @ 09:27am

Until I read here about clear, I used float with display: table ... I was stupid ...I know

healthcare said...
01.10.2009 @ 04:25am

actually works

Online Sameday Payday Loans said...
25.09.2009 @ 06:15am

Good suggestion for web developers and webdesigner through your blog! ---- Thanks

Monroe Computer Repair said...
23.09.2009 @ 11:46pm

LOL of course IE is excluded, but this is a great tip. No more extra div for clearing.

marseille said...
21.09.2009 @ 03:33pm

haha, it's hard to stop the

, but that's a good practice, thanks!

Arveno said...
20.09.2009 @ 10:56am

Thanks for your post. The clear statement in HTML has been very confusing to me before.

HCG diet Seattle said...
19.09.2009 @ 08:50am

Calling all Gurus! Which Clearfix is best? .clearfix - not clearing method!
So I'm working on my demo here and now I move onto the clearfix method. While doing some reading I came across this article by Perishable Press. As Paul would put it, he amalgamated the clearfix method a little. Makes sense to me - what do you think? Heard anything about his changes? I understand the reasoning behind the font-size: 0; but what about the space void of the "dot". Thoughts???

Also, if I wanted to remove IE5 from it would it look like this? That's who the hacky stuff is for right?

.clearfix:after {
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
.clearfix {display:inline-block;}
* html .clearfix {height: 1%;}

mercer tools said...
19.09.2009 @ 04:58am

The ClearFix hack was great — it was actually a life saver several years ago when cross-browser support and CSS never played nice. We wanted to be table-less and needed floats to control our multi-column layouts; but then there was the clearing issue and ClearFix was there to save us every time.

Now things are getting better and the push to have standards-based mark-up and valid CSS with little to no hacks or filters is growing. Everyday we are getting closer and closer to creating complex layouts that require no conditional comments, no hacks and no filters – and stay perfectly valid and semantic. In a continuing effort to move in that direction — we had to seek out an alternative to everyones favorite hack; ClearFix.

There are hundreds of blog posts on this topic, it seems to highly talked about. But, we needed a solution just right or us and using the overflow property wasn’t flexible enough and other solutions didn’t validate perfectly

Lara ROme said...
18.09.2009 @ 10:10am

Yet again another great post

arab-ia said...
15.09.2009 @ 10:30pm

Good tip. Been using this with all my floated elements now ever since I saw Dan Cederholm's site using it. Works great for the way I like to code front-ends.

Backpacks for laptops said...
13.09.2009 @ 12:56am

Wow this actually works. I passed it on to my web designer... I'm still learning how to do CSS and your articles are fantastic for newbies. Really appreciate you sharing!

Bruno said...
04.09.2009 @ 08:01am

Marry me!!!

Poptropica said...
03.09.2009 @ 03:08pm

i like your blog and your tutorial HTML ..!!!

Deaf school said...
29.08.2009 @ 01:14pm


nice blog.. liked it very much....can someone give me some other related blog address..???ne ways appreciated..!!!

Alicia Norton said...
28.08.2009 @ 07:10am

Thanks for sharing these kind if informative news.

Daniel said...
25.08.2009 @ 10:05am

Thanks for the tip! I'll try it out on my next layout!

Perdele said...
03.04.2009 @ 10:22am

Nice tutorial, your clearfix working well. Thanks! I'll test on all browsers soon.

Josh said...
13.11.2008 @ 09:52pm

Good tip. Been using this with all my floated elements now ever since I saw Dan Cederholm's site using it. Works great for the way I like to code front-ends.

Jenna said...
20.09.2008 @ 12:42pm

Kalyan,

IE should not require this fix as it incorrectly wraps floated elements by default. If something appears buggy and you think this is the problem, it is more than likely a hasLayout issue, rather than a clearfix issue.

Try adding "height: 1%;" to whatever element has problems in IE and 9 times out of 10 it will fix it!

Kalyan said...
17.09.2008 @ 03:57am

As far as i have seen, the overflow and the :after technique will work on all browsers except IE. So we will have to use the empty divs for IE
or
We can also apply the clear:both to the footer div tag directly and works like a charm without the need for browser specific fixes.

Jenna said...
30.08.2008 @ 07:15am

Oooh yes, using 'overflow' is another solution. Good find with the sitepoint article btw!

I have used the 'overflow: hidden' option in the past but when creating templates, this clearfix method is generally the only one I trust downloaders won't have problems with (tackling possible scrollbars and disappearing overflowed content).

I may try testing overflow some more and see how high the chances are of these issues cropping up/how to avoid them because it would be a far simpler solution!

Mike Weiss said...
29.08.2008 @ 03:32pm

I found this the other day. Worked like a charm on the website I needed it for. It was so simple I had to chuckle a bit when I found it.

Bob Baker said...
28.08.2008 @ 02:55pm

Great info Jenna! Thanks!

Add your thoughts

Fields in bold are required.

Add a comment



Who am I?

I am Jenna Smith - a front end web developer who has been busy coding XHTML & CSS for the last 6 years. If you are interested in seeing my work or getting in touch you can do so through my growldesign website.