Created
September 27, 2012 18:57
-
-
Save schadeck/3795748 to your computer and use it in GitHub Desktop.
Using overflow: hidden to prevent text wrapping around a floated element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Using overflow: hidden to prevent text wrapping around a floated element | |
*/ | |
div { width: 400px; margin: 25px auto; } | |
img { float: left; margin-right: 1em; } | |
span { display: block; overflow: hidden; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- content to be placed inside <body>…</body> --> | |
<div> | |
<img src="http://img.schadeck.com/100" alt="pic"> | |
<span>Terry richardson pork belly chillwave, mcsweeney's brunch 3 wolf moon ennui vinyl hella single-origin coffee irony hoodie seitan. Mlkshk vice VHS mustache, cray shoreditch gentrify mcsweeney's irony leggings lo-fi authentic. Pork belly authentic gentrify, typewriter cosby sweater chambray ennui pop-up tumblr bicycle rights american apparel organic.</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment