fix: Fix clearfix code and update description

Updating cleafix code to use display block and fix margin collapse. More info http://cssmojo.com/the-very-latest-clearfix-reloaded/
This commit is contained in:
Mattia Astorino
2018-02-26 21:26:32 +01:00
parent c91818a069
commit 7ce95f70e5
8 changed files with 4106 additions and 4 deletions

View File

@ -2,6 +2,8 @@
Ensures that an element self-clears its children.
###### Note: This is useful only if you are still using float to build layouts. Please consider to use a modern approach with flexbox layout or grid layout.
#### HTML
```html
@ -17,7 +19,7 @@ Ensures that an element self-clears its children.
```css
.clearfix::after {
content: '';
display: table;
display: block;
clear: both;
}
@ -39,7 +41,7 @@ Ensures that an element self-clears its children.
<style>
.snippet-demo__clearfix::after {
content: '';
display: table;
display: block;
clear: both;
}