Created
June 2, 2018 10:04
-
-
Save cesarandreu/3e87cb6993bedeb162b5648222eb67bf to your computer and use it in GitHub Desktop.
Sensible css defaults taken from css-layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| div, span { | |
| box-sizing: border-box; | |
| position: relative; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: stretch; | |
| flex-shrink: 0; | |
| align-content: flex-start; | |
| border: 0 solid black; | |
| margin: 0; | |
| padding: 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from css-layout README:
box-sizing: border-boxis the most convenient way to express the relation betweenwidthandborderWidth.display: flexby default. All the behaviors ofblockandinline-blockcan be expressed in term offlexbut not the opposite.position: relative. This makesposition: absolutetarget the direct parent and not some parent which is eitherrelativeorabsolute. If you want to position an element relative to something else, you should move it in the DOM instead of relying of CSS. It also makestop, left, right, bottomdo something when not specifyingposition: absolute.