Last active
August 29, 2015 14:20
-
-
Save ffoodd/e35bfaffa047ca96e877 to your computer and use it in GitHub Desktop.
Flexbox layout
This file contains 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
/** | |
* Flexbox layout | |
*/ | |
*:not(html) { | |
background: rgba(30, 144, 255, .5); | |
color: white; | |
font-family: sans-serif; | |
font-weight: 700; | |
padding: 1em; | |
text-align:center; | |
} | |
body { | |
display: flex; /* crée un contexte flex pour ses enfants */ | |
flex-direction: column; /* affichage vertical */ | |
margin: 0; | |
min-height: 100vh; /* toute la hauteur du viewport (compatible IE9+) */ | |
padding: 0; | |
} | |
main { | |
display: flex; | |
flex: 1; | |
flex-direction: row; | |
} | |
main nav, | |
main aside { | |
flex: 0 1 10vw; | |
} | |
main div { | |
background: orange; | |
color: black; | |
flex: 1 0 80vw; | |
} |
This file contains 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
<!-- content to be placed inside <body>…</body> --> | |
<header>Entête</header> | |
<main> | |
<nav>Sommaire</nav> | |
<div>Contenu</div> | |
<aside>Réglages</aside> | |
</main> | |
<nav>Navigation</nav> |
This file contains 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
// alert('Hello world!'); |
This file contains 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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment