I am learning how to vertically align element and found one approach(Floater Div) here: http://www.vanseodesign.com/css/vertical-centering/
**HTML**
<div id="parent">
<div id="floater"></div>
<div id="child">Content here</div>
</div>
**CSS**
#parent {height: 250px;}
#floater {
float: left;
height: 50%;
width: 100%;
margin-bottom: -50px;
}
#child {
clear: both;
height: 100px;
}
Why we need #floater to be floated? Deleting float:left and clear: both still works. What's the benefit of making it floated?
I know there are lots of ways to vertically align element, and seems each of them have some disadvantage like you need to know the height; old IE won't work; multiple lines won't work and so on. But for this approach it put one element to fill up the entire upper half of the parent element. I just wonder why this element need to be floater?