Skip to content

Instantly share code, notes, and snippets.

@mbtrs
Created December 4, 2022 05:28
Show Gist options
  • Select an option

  • Save mbtrs/4066f9037a0823f809e886e3bbeb4010 to your computer and use it in GitHub Desktop.

Select an option

Save mbtrs/4066f9037a0823f809e886e3bbeb4010 to your computer and use it in GitHub Desktop.
Example with MQs and Source Order
<div class="container">
<div class="first">First Priority</div>
<div class="second">Second Priority</div>
<div class="third">Third Priority</div>
</div>
<p class="p">Demo by Chris Poteet. <a href="http://www.sitepoint.com/introduction-mobile-first-media-queries" target="_blank">See article</a>.</p>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font: 24px arial, sans-serif;
text-align: center;
}
.container {
overflow: hidden;
}
.first, .third {
height: 300px;
background: PeachPuff;
padding: 20px;
}
.second {
height: 300px;
background: MediumAquamarine;
padding: 20px;
}
@media (min-width: 40em) {
.first {
float: left;
width: 25%;
}
.second {
float: left;
width: 50%;
}
.third {
float: left;
width: 25%;
}
}
.p {
font-size: 13px;
padding-top: 120px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment