Skip to content

Instantly share code, notes, and snippets.

@kravemir
Created February 25, 2020 12:26
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 kravemir/a4d8963cefc1c4485df9a058c98d6415 to your computer and use it in GitHub Desktop.
Save kravemir/a4d8963cefc1c4485df9a058c98d6415 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/xoyisaw
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
* {
box-sizing: border-box;
}
.main-container {
display: flex;
}
.item {
width: 50%;
}
.photo-container {
background: #AAF;
display: flex;
align-items: center;
justify-content: space-around;
padding: 1rem;
}
.photo {
background: #55F;
width: 140px;
height: 220px;
border: solid 1px #33F;
}
.product-details h1 {
background: #FAA;
margin: 0;
padding: 1rem;
}
.product-description {
background: #FFA;
padding: 1rem;
}
@media (max-width: 600px) {
.main-container {
flex-direction: column;
}
.item {
width: 100%;
}
.product-details {
display: contents;
}
.product-details h1 {
order: -1;
}
}
</style>
</head>
<body>
<div class="main-container">
<div class="item photo-container">
<div class="photo"></div>
</div>
<div class="item product-details">
<h1>Product name</h1>
<div class="product-description">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
</div>
<script id="jsbin-source-css" type="text/css">* {
box-sizing: border-box;
}
.main-container {
display: flex;
}
.item {
width: 50%;
}
.photo-container {
background: #AAF;
display: flex;
align-items: center;
justify-content: space-around;
padding: 1rem;
}
.photo {
background: #55F;
width: 140px;
height: 220px;
border: solid 1px #33F;
}
.product-details h1 {
background: #FAA;
margin: 0;
padding: 1rem;
}
.product-description {
background: #FFA;
padding: 1rem;
}
@media (max-width: 600px) {
.main-container {
flex-direction: column;
}
.item {
width: 100%;
}
.product-details {
display: contents;
}
.product-details h1 {
order: -1;
}
}</script>
</body>
</html>
* {
box-sizing: border-box;
}
.main-container {
display: flex;
}
.item {
width: 50%;
}
.photo-container {
background: #AAF;
display: flex;
align-items: center;
justify-content: space-around;
padding: 1rem;
}
.photo {
background: #55F;
width: 140px;
height: 220px;
border: solid 1px #33F;
}
.product-details h1 {
background: #FAA;
margin: 0;
padding: 1rem;
}
.product-description {
background: #FFA;
padding: 1rem;
}
@media (max-width: 600px) {
.main-container {
flex-direction: column;
}
.item {
width: 100%;
}
.product-details {
display: contents;
}
.product-details h1 {
order: -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment