Safari Clearfix Bug

Feb 16, 08:30 PM By Eoghan O'Brien.

I’m not sure if this has been mentioned before, but if you’ve ever used the clearfix you’ll have come across the content: property with a value of ”.”;

.clearfix:after {
content: ”.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}

What you might not have noticed is the that in Safari that dot value ”.” is actually shown on the page. So if, like me, you were scratching your head looking for an answer to this, I hope this helps.

The solution is quite obvious and very simple but hopefully using this page as a resource will save you time scouring your css for errors.

All you need to do is replace the ”.” with ” ” and no more strange dots appearing on your screen, the clearfix works just the same so all is good.

.clearfix:after {
content: ” ”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
Commenting is closed for this article.
SIDENOTES

Understanding Web Design

Zeldman explains where web design differs from print design and the importance of designing dynamically. Very intelligent essay.

Cruciforum: Crucially Simple

A super simple lightweight piece of forum software from Stuart Langridge in just one PHP file. Drop it in a directory and you’re done.

A List Apart Survey Results

Close to 33,000 web professionals answered the survey’s 37 questions, providing the first data ever collected on the business of web design and development as practiced in the U.S. and worldwide.

Eric Meyer's CSS Reset

Meyer sets out to reset all browser’s default styles. IE inheritance support is a little frustrating though.

The Web Design Survey

Take 10 minutes to help A List Apart form a picture of the ways web design is practiced around the globe.

Subscribe to this Feed
LIVESEARCH
RECENT ARTICLES