Created
April 30, 2013 12:40
-
-
Save maxhoffmann/5488453 to your computer and use it in GitHub Desktop.
Fixing inline-block + overflow: hidden in Firefox + Opera
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
/** | |
* Fixing inline-block + overflow: hidden in Firefox + Opera | |
*/ | |
.overflow { | |
max-width: 100%; | |
overflow: hidden; | |
white-space: nowrap; | |
} | |
.inline-block { | |
display: inline-block; | |
} | |
.inline-block-fixed { | |
display: inline-block; | |
vertical-align: top; | |
} | |
/* resets */ | |
.container { | |
float: left; | |
margin-left: 20px; | |
width: 200px; | |
border: 2px solid red | |
} | |
h3 { text-align: center; } | |
p { margin: 0 } |
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
<h1>fixing inline-block + overflow: hidden in Firefox + Opera</h1> | |
<div class="container"> | |
<h3>without v-align: top</h3> | |
<p class="overflow inline-block">lorem ipsum dolor lorem ipsum dolor</p> | |
<p>next paragraph</a> | |
</div> | |
<div class="container"> | |
<h3>with vertical-align: top</h3> | |
<p class="overflow inline-block-fixed">lorem ipsum dolor lorem ipsum dolor</p> | |
<p>next paragraph</a> | |
</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
// alert('Hello world!'); |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment