Skip to content

Instantly share code, notes, and snippets.

@benjohnson
Created September 26, 2013 15:35
Show Gist options
  • Save benjohnson/6715920 to your computer and use it in GitHub Desktop.
Save benjohnson/6715920 to your computer and use it in GitHub Desktop.
Untitled
.ico {
width:16px;
height:16px;
background: red;
margin-right: 5px;
display: inline-block;
}
.wrapper {
width: 200px;
margin-bottom: 20px;
}
.ico-space {
position: relative;
padding-left: 22px;
}
.ico-space .ico {
position: absolute;
top: 0;
left: 0;
}
.floated {
overflow: hidden;
}
.floated .ico, .floated p {
float: left;
margin: 0;
}
<div class="wrapper ico-space">
<span class="ico"></span>This is some text that will wrap. This is some text that will wrap. This is some text that will wrap.
</div>
<div class="wrapper floated">
<span class="ico"></span><p>This is some text that will wrap. This is some text that will wrap. This is some text that will wrap.</p>
</div>
<div class="wrapper floated">
<span class="ico"></span><p>This is some text.</p>
</div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"110","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment