This is starting to drive me nuts, any help appreciated!
I would like to have each <li>
that isn't "fixed" to have a maximum width of say 150px, and a minimum width of say 10px, however when the browser is resized down, they should shrink to fix (and be equal in width). I would also like the text within each non "fixed" <li>
to have text-overflow: ellipsis.
I just can't seem to get this working, so far I have:
HTML:
<ul>
<li class="fixed">Fixed Size</li>
<li>
<div>
<span>this text is very very long and it goes on and on and on and on but does not wrap</span>
</div>
</li>
<li><div>
<span>short</span>
</div></li>
<li><div>
<span>one more tab</span>
</div></li>
<li><div>
<span>another tab</span>
</div></li>
</ul>
CSS:
ul {
margin: 0;
padding: 0;
list-style: none;
display: table;
border-spacing: 6px 0px;
}
li {
display: table-cell;
background-color: red;
width: 150px;
}
li > div {
overflow: hidden;
text-overflow: ellipsis;
}
li > div > span {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
li.fixed {
width: 100px;
min-width: 100px;
text-align: center;
}
UPDATE: this shows what I'm after with the columns but as you can see the text isn't hidden with the ellipsis:
UPDATE: this is getting closer, but still no ellipsis :-(
UPDATE: SOLVED Solution posted below.