This also helps ensure consistency within Internet Explorer 6 and 7. The :before pseudo-element is used to prevent the top margin of child elements from collapsing by creating an anonymous table-cell element using the display: table declaration. Using these pseudo-elements we can create hidden elements above and below the parent containing the floats. The clearfix technique is based off using the :before and :after pseudo-elements on the parent element. The clearfix technique is a bit more complex but does have better support as compared to the overflow technique. Depending on the context of the floated elements a better technique to contain floats may be the clearfix technique.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |