Skip to content

Instantly share code, notes, and snippets.

@Brentophillips
Created June 25, 2015 18:52
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 Brentophillips/a606210b2d040f87b382 to your computer and use it in GitHub Desktop.
Save Brentophillips/a606210b2d040f87b382 to your computer and use it in GitHub Desktop.
Responsive Text Boxes
<div id="page">
<div class="container">
<div class="body">
<p>
Hi, this is a paragraph in a box.
<br>And I am simply typing some random text to fill in this box.
</p>
</div>
<div class="upArrow"></div>
</div>
<div class="container">
<div class="body">
<p>
Hi, this is a paragraph in a box.
<br>And I am simply typing some random text to fill in this box.
</p>
</div>
<div class="upArrow"></div>
</div>
<div class="container">
<div class="body">
<p>
Hi, this is a paragraph in a box.
<br>And I am simply typing some random text to fill in this box.
</p>
</div>
<div class="upArrow"></div>
</div>
<div class="container">
<div class="body">
<p>
Hi, this is a paragraph in a box.
<br>And I am simply typing some random text to fill in this box.
</p>
</div>
<div class="upArrow"></div>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
@border-color: orange;
@border-bottom-color: #ccc;
@border-size: 5px;
#page {
max-width: 80%;
margin: auto;
}
.container {
margin: 20px;
margin-bottom: 0;
position: relative;
display: inline-block;
}
.body {
position: relative;
padding: 10px;
width: 80%;
background: #444;
border-top: @border-size solid @border-color;
border-bottom: 2px solid @border-bottom-color;
color: white;
font-family: georgia;
font-size: 14px;
line-height: 1.5;
box-shadow: inset 0 0 @border-size #333;
}
.upArrow {
position: absolute;
top: @border-size;
left: 80%;
margin-left: -@border-size;
width: 0;
height: 0;
border-left: @border-size solid transparent;
border-right: @border-size solid transparent;
border-top: @border-size solid @border-color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment