Results 1 to 10 of 10
Threaded View
-
28th Apr 2011, 01:21 AM #1OPMember
The modern ClearFix
Many people here still use 10 years old method to clear floats aka ClearFix, using markup. Which is a terrible coding practice.
( something like.. <div class='clearfix'></div>)
So had to share the better way of doing that using CSS psuedo elements:-
Code:.clearfix:after{ clear: both; content: ""; display: block; }
Live Demo: http://jsfiddle.net/ccxRJ/1/embedded/result/
Compatibility: IE8+, FF3.5+, Safari 1.3+, Opera 9.5+ and Google Chrome 2+
There is another method but is often problematic:-
Code:.clearfix { overflow: hidden; }
P.S: if u don't know what is ClearFix then this tutorial is not for you.SalmanAbbas007 Reviewed by SalmanAbbas007 on . The modern way to clear floats Many people here still use 10 years old method to clear floats aka ClearFix, using markup. Which is a terrible coding practice. ( something like.. <div class='clearfix'></div> :|) So had to share the better way of doing that using CSS psuedo elements:- .clearfix:after{ clear: both; content: ""; display: block; } Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
How to clear your DNS cache
By Areon in forum Server ManagementReplies: 0Last Post: 1st Mar 2014, 10:24 AM -
Boxbilling Clear-Up
By junjunjun in forum Webmaster DiscussionReplies: 1Last Post: 24th Aug 2012, 08:27 AM -
Clear .txt files
By viruz99 in forum General DiscussionReplies: 6Last Post: 23rd Dec 2011, 08:29 AM -
Please clear this up for me
By priviet02 in forum Legal IssuesReplies: 8Last Post: 23rd Sep 2008, 01:45 AM
themaCreator - create posts from...
Version 3.56 released. Open older version (or...