Skip to content

Instantly share code, notes, and snippets.

@joews
Created June 13, 2014 09:23
Show Gist options
  • Save joews/ed7130af97d7cac571fe to your computer and use it in GitHub Desktop.
Save joews/ed7130af97d7cac571fe to your computer and use it in GitHub Desktop.
Untitled
**
* The first commented line is your dabblet’s title
*/
.wrapper {
position: relative;
}
.line {
position: absolute;
height: 1px;
width: 100%;
background-color: white;
}
.line.top {
top: 53px;
}
.line.bottom {
top: 65px;
}
p.a {
background-color: steelblue;
}
p.b {
background-color: lightgray;
}
p {
margin: 0;
height: 100px;
font-size: 20px;
font-family: 'Lucida Grande';
color: white;
}
span {
/* can be any value to change text height inside p without pushing down the next element */
line-height: 100px;
}
<div class="wrapper">
<p class="a"><span>Here is some text</span></p>
<div class="line top"></div>
<div class="line bottom"></div>
<p class="b">I am not pushed down when above span's line-height changes.</p>
</div>
// alert('Hello world!');
{"view":"separate","fontsize":"80","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment