CSS Floating Inline Elements (960 GS)

I just looked at the code 906.gs css and noticed that they made all the floating divs inline.

http://960.gs/demo.html

Just wondering what the goal is ... I'm always interested in learning CSS theories.

+3
css
source share
1 answer

An element with float: left forced to have a computed display block value.

For more on this, see: jQuery in Chrome returns โ€œblockโ€ instead of โ€œinlineโ€

The purpose of adding display: inline is to fix the IE6 error, "double-edge error":

http://www.positioniseverything.net/explorer/doubled-margin.html

The encoder innocently places the left float in the container box and uses the left edge on the float to push it off the left side of the container. Seems pretty simple, right? Well, this is until it is shown in IE6. In this browser has a left float. mysteriously doubled in length!

This is a free fix without flaws (even in IE6):

This means that {display: inline;} on the float should not differ from using {display: block;} (or no display value at all), and indeed all browsers follow this specification, including IE. But this somehow calls IE to stop the float field doubling. Thus, this correction can be applied directly, without the fussy hide of Methods.

In fact, you can simply apply Inline Fix to all floats if you want, as there are no known side effects. Thus, an error will never fail traction regardless of any fields that you may or may not use.

+4
source share

All Articles