Skip to content

Instantly share code, notes, and snippets.

@ryanpcmcquen
Created September 6, 2014 03:53
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 ryanpcmcquen/6df5fff555659ca40a12 to your computer and use it in GitHub Desktop.
Save ryanpcmcquen/6df5fff555659ca40a12 to your computer and use it in GitHub Desktop.
3 responsive columns
/* 3 responsive columns */
@media all and (min-width: 1080px) {
.box {
float: left;
}
.box:nth-child(-n+2) {
margin-right: 1em;
}
.box-container {
display: flex;
align-items: center;
justify-content: center;
}
}
@media all and (max-width: 1079px) {
.box {
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
position: relative;
clear: both;
display: block;
}
.box-container {
display: block;
clear: both;
margin-left: auto;
margin-right: auto;
text-align: center;
}
}
.box {
width: 20em;
height: 15em;
border: 1px solid #000000;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.7);
text-align: center;
}
.box-container {
position: relative;
}
<div class="box-container">
<div class="box">
1
</div>
<div class="box">
2
</div>
<div class="box">
3
</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment