Skip to content

Instantly share code, notes, and snippets.

@rkmax
Created March 4, 2017 15:27
Show Gist options
  • Save rkmax/e1047d78babf5f71630432491585fc84 to your computer and use it in GitHub Desktop.
Save rkmax/e1047d78babf5f71630432491585fc84 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/muguzav
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background: red;
}
.item {
display: flex;
height: 107px;
width: 400px;
overflow: hidden;
color: white;
}
.item .before {
display: block;
width: 132px;
height: 107px;
background: url(https://s3.amazonaws.com/l3-web/left-1.png) no-repeat;
}
.item .after {
display: block;
width: 80px;
height: 107px;
background: url(https://s3.amazonaws.com/l3-web/right-2.png) no-repeat;
}
.item .content {
flex-grow: 1;
display: flex;
align-items: center;
height: 107px;
background: url(https://s3.amazonaws.com/l3-web/center-2.png) repeat-x;
background-size: contain;
}
.last-item .before {
background: url(https://s3.amazonaws.com/l3-web/left-2.png) no-repeat;
}
</style>
</head>
<body>
<div class="item">
<div class="before"></div>
<div class="content"><p>Hello my friend</p></div>
<div class="after"></div>
</div>
<div class="item">
<div class="before"></div>
<div class="content"><p>Lorem ipsum dolor sit amet</p></div>
<div class="after"></div>
</div>
<div class="item last-item" style="width: 70%">
<div class="before"></div>
<div class="content"><p>consectetur adipiscing elit. Donec eu</p></div>
<div class="after"></div>
</div>
<script id="jsbin-source-css" type="text/css">body {
background: red;
}
@h: 107px;
@w: 400px;
.item {
display: flex;
height: @h;
width: @w;
overflow: hidden;
//background: yellow;
color: white;
.before {
display: block;
width: 132px;
height: @h;
background: url(https://s3.amazonaws.com/l3-web/left-1.png) no-repeat;
}
.after {
display: block;
width: 80px;
height: @h;
background: url(https://s3.amazonaws.com/l3-web/right-2.png) no-repeat;
}
.content {
flex-grow: 1;
display: flex;
align-items: center;
//justify-content: center;
height: @h;
background: url(https://s3.amazonaws.com/l3-web/center-2.png) repeat-x;
background-size: contain;
}
}
.last-item {
.before {
background: url(https://s3.amazonaws.com/l3-web/left-2.png) no-repeat;
}
}</script>
</body>
</html>
body {
background: red;
}
.item {
display: flex;
height: 107px;
width: 400px;
overflow: hidden;
color: white;
}
.item .before {
display: block;
width: 132px;
height: 107px;
background: url(https://s3.amazonaws.com/l3-web/left-1.png) no-repeat;
}
.item .after {
display: block;
width: 80px;
height: 107px;
background: url(https://s3.amazonaws.com/l3-web/right-2.png) no-repeat;
}
.item .content {
flex-grow: 1;
display: flex;
align-items: center;
height: 107px;
background: url(https://s3.amazonaws.com/l3-web/center-2.png) repeat-x;
background-size: contain;
}
.last-item .before {
background: url(https://s3.amazonaws.com/l3-web/left-2.png) no-repeat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment