Created
December 4, 2022 05:28
-
-
Save mbtrs/4066f9037a0823f809e886e3bbeb4010 to your computer and use it in GitHub Desktop.
Example with MQs and Source Order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * { | |
| 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