Created
November 2, 2012 18:04
-
-
Save jelur/4003236 to your computer and use it in GitHub Desktop.
Untitled
This file contains hidden or 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
| body { | |
| font-family: sans-serif; | |
| } | |
| ul { | |
| list-style: none | |
| } | |
| li { | |
| background: slategrey; | |
| display: inline-block; | |
| /* inline block hack for IE 6&7 */ | |
| zoom: 1; | |
| *display: inline; | |
| padding: 4px; | |
| color: white | |
| } | |
| ul.white-space-fix li { | |
| margin-right: -4px; | |
| } | |
| ul.zero-size { | |
| font-size: 0px; | |
| } | |
| ul.zero-size li { | |
| font-size: 16px; | |
| } | |
| ul.spacing-tweak { | |
| word-spacing:-4px; | |
| } | |
| ul.spacing-tweak li { | |
| word-spacing:1px; | |
| } |
This file contains hidden or 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>Inline-block / white-space bug</h1> | |
| original... | |
| <ul> | |
| <li>one</li> | |
| <li>two</li> | |
| <li>three</li> | |
| </ul> | |
| fixed by funky code formatting... | |
| <ul> | |
| <li> | |
| one</li><li> | |
| two</li><li> | |
| three</li> | |
| </ul> | |
| fixed by adding html comments... | |
| <ul> | |
| <li>one</li><!-- | |
| --><li>two</li><!-- | |
| --><li>three</li> | |
| </ul> | |
| fixed by CSS margin-right: -4px; (breaks in IE6&7)... | |
| <ul class="white-space-fix"> | |
| <li>one</li> | |
| <li>two</li> | |
| <li>three</li> | |
| </ul> | |
| fixed by omitting the </li> | |
| <ul> | |
| <li>one | |
| <li>two | |
| <li>three | |
| </ul> | |
| fixed with font-size: 0 via: http://twitter.com/#!/garand/status/183253526313566208 | |
| <br><br> | |
| <ul class="zero-size"> | |
| <li>one</li> | |
| <li>two</li> | |
| <li>three</li> | |
| </ul> | |
| <br> | |
| fixed by playing with word-spacing | |
| <br> | |
| <ul class="spacing-tweak"> | |
| <li>one</li> | |
| <li>two</li> | |
| <li>three</li> | |
| </ul> | |
This file contains hidden or 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