Created
September 2, 2015 02:25
-
-
Save oli/9aa1d229128ed04110cf to your computer and use it in GitHub Desktop.
Flexbox and ellipsis
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
/** | |
* Flexbox and ellipsis | |
*/ | |
ul { | |
display: flex | |
list-style: none; | |
white-space: nowrap; /* Stops line wrapping */ | |
} | |
li { | |
overflow: hidden; /* Prevents overflow from expanding container */ | |
border: 1px solid #eee; | |
text-overflow: ellipsis; /* needed on flexbox child */ | |
} | |
a { | |
display: inline; /* Must be inline to ellipsise */ | |
margin-right: 1em; | |
font-size: 2em; | |
text-decoration: none; | |
} | |
p { | |
margin: 2em; | |
border: 1px solid #eee; | |
padding: 2em; | |
} | |
p:hover { | |
color: red; | |
} |
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
<ul> | |
<li><a href="">OneOneOne</a> | |
<a href="">TwoTwoTwo</a> | |
<a href="">ThreeThreeThree</a> | |
<a href="">FourFourFour</a> | |
<a href="">Four Four Four</a></li> | |
</ul> | |
<p>test</p> |
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