Skip to content

Instantly share code, notes, and snippets.

@cherring
Created April 19, 2016 12:37
Show Gist options
  • Save cherring/d65111fe3a11a3e4dc2193de9beef45e to your computer and use it in GitHub Desktop.
Save cherring/d65111fe3a11a3e4dc2193de9beef45e to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" media="screen" href="style.css" />
</head>
<body>
<br>
<div class="page-content">
<div class="wrapper">
<div class="first">
I am a div that is first
</div>
<div class="second">
I am a div that is second
</div>
</div>
</div>
</body>
</html>
* {
padding: 0;
margin: 0;
}
.wrapper {
width: 100%;
display: inline-block;
}
.first {
width: 49%;
background: green;
color: white;
display: inline-block;
@media screen and (max-width: 414px){
width: 100%;
}
}
.second {
width: 49%;
background: blue;
color: white;
display: inline-block;
}
/* 414 just because it's the width of a 6(s)plus */
@media screen and (max-width: 414px){
.first {
display: inline-block;
width: 100%;
}
.second {
display: inline-block;
width: 100%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment