Skip to content

Instantly share code, notes, and snippets.

@ron4stoppable
Last active March 28, 2016 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ron4stoppable/872963ffd876e52e1721 to your computer and use it in GitHub Desktop.
Save ron4stoppable/872963ffd876e52e1721 to your computer and use it in GitHub Desktop.
center div with box model
/**
* center div with box model
*/
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css);
.row{
width:100%;
/* Firefox */
display:-moz-box;
-moz-box-pack:center;
-moz-box-align:center;
/* Safari and Chrome */
display:-webkit-box;
-webkit-box-pack:center;
-webkit-box-align:center;
/* W3C */
display:box;
box-pack:center;
box-align:center;}
.cols{
width: 25%;
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%
}
<!-- content to be placed inside <body>…</body> -->
<div class="row">
<div class="cols"><i class="fa fa-reddit-alien"></i><p> Reddit </p></div>
<div class="cols"><i class="fa fa-car"></i><p>Car</p></div>
</div>
// alert('Hello world!');
{"view":"separate","fontsize":"100","seethrough":"1","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment