Skip to content

Instantly share code, notes, and snippets.

@doctyper
Created November 4, 2010 21:04
Show Gist options
  • Save doctyper/663187 to your computer and use it in GitHub Desktop.
Save doctyper/663187 to your computer and use it in GitHub Desktop.
/* what was in style.css */
body, html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
.hbox.center.alignCenter {
background-color: gray;
width:100%;
height:100%;
}
.vbox.center.alignCenter {
background-color: yellow;
width: 100px;
height: 200px;
}
.foo {
width: 50px;
height: 50px;
background-color: red;
}
.bar {
width: 50px;
height: 50px;
background-color: blue;
}
/* hbox and vbox classes */
.hbox {
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: stretch;
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-align: stretch;
display: box;
box-orient: horizontal;
box-align: stretch;
}
.hbox > * {
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
display: block;
}
.vbox {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-align: stretch;
display: -moz-box;
-moz-box-orient: vertical;
-moz-box-align: stretch;
display: box;
box-orient: vertical;
box-align: stretch;
}
.vbox > * {
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
display: block;
}
.spacer {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
}
.reverse {
-webkit-box-direction: reverse;
-moz-box-direction: reverse;
box-direction: reverse;
}
.boxFlex0 {
-webkit-box-flex: 0;
-moz-box-flex: 0;
box-flex: 0;
}
.boxFlex1, .boxFlex {
-webkit-box-flex: 1;
-moz-box-flex: 1;
box-flex: 1;
}
.boxFlex2 {
-webkit-box-flex: 2;
-moz-box-flex: 2;
box-flex: 2;
}
.start {
-webkit-box-pack: start;
-moz-box-pack: start;
box-pack: start;
}
.end {
-webkit-box-pack: end;
-moz-box-pack: end;
box-pack: end;
}
.center {
-webkit-box-pack: center;
-moz-box-pack: center;
box-pack: center;
}
.alignCenter {
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment