I can find an evolution of clearfix across the years, but my latest is what Tom
uses, except I use IE conditional stylesheets for IE miscellany.
Or did. As of last quarter IE7 is dead to me ... IE8 will be before the end of
2014. In fact, it looks like I'll only have to deal with IE9 remnants and IE11+
(the auto-update for IE10 is doing its job).
As far as hacking or clean up ... if you are using valid CSS and not 'hacking'
CSS, there shouldn't be much (if any) cleanup. At the point where we say "IE7
is dead to us" then my only action is that the next time we visit substantial
design changes on a website, I remove the IE7 conditional statement from the
layout template(s) of that site, and delete the file from the project in the
cleanup.
@John: I have high hopes for flex. We're undergoing our first major semantic
upgrade in 6 years of the Gallup main website late this year. How much I
actually end up being able to adopt on the HTML5/CSS3 will depend almost
entirely on timing optimization of various techniques. So floats and clears vs.
flex vs. lightweight scripting will all end up getting performance tested using
our content as we prep for traffic spikes. Saving our visitors milliseconds
will trump which method is used. On the bright side, it's all getting gutted
and nothing is sacred. It will be a fun year.
ELIZABETH DAVIES
Gallup
Input | Intellection | Learner | Achiever | Belief
In my opinion, a CSS hack is an exploit of browser behavior (or
misbehavior) to "solve", in this case, a layout issue. And to be clear,
"clearfix" as an idea, is not in the spec as a self contained "thing".
"Clearfix" is a group of CSS definitions.
Here is the clearfix I use:
/* CLEARING */
/* For modern browsers */
.clear:before, .clear:after {content:""; display:block;} .clear:after
{clear:both;} .clear {zoom:1;}/* For IE 6/7 (trigger hasLayout) */
While these definitions are using real in-the-spec css, they are taking
advantage of browser behaviors to cause a wrapper element to contain floated
elements within it.
Smarter people, feel free to correct me...
HTH
--
Tom Livingston | Senior Front-End Developer | Media Logic |
ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/ List policies --
http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
All information in this message is confidential and may be legally privileged.
Only intended recipients are authorized to use it.
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/