Skip to content

Instantly share code, notes, and snippets.

@demsone
Created June 17, 2013 00:08
Show Gist options
  • Save demsone/5793946 to your computer and use it in GitHub Desktop.
Save demsone/5793946 to your computer and use it in GitHub Desktop.
Flexbox - new modal box
body {
display: -webkit-box; /* OLD: Safari, iOS, Android browser, older WebKit browsers. */
display: -moz-box; /* OLD: Firefox (buggy) */
display: -ms-flexbox; /* MID: IE 10 */
display: -webkit-flex; /* NEW, Chrome 21+ */
display: flex; /* NEW: Opera 12.1, Firefox 22+ */
-webkit-box-align: center; -moz-box-align: center; /* OLD… */
-ms-flex-align: center; /* You know the drill now… */
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center; -moz-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
margin: 0;
height: 100%;
width: 100% /* needed for Firefox */
}
h1 {
display: -webkit-box; display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center; -moz-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
height: 10rem;
}
/* http://coding.smashingmagazine.com/2013/05/22/centering-elements-with-flexbox/ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment