I need help with setting the CSS for an unordered list inside a container. I want the last list item to show and the leftmost item to be hidden when there is not enough space in the container.
Order: li1 > li2
After adding li4, the order should be:
li2 > li3
I want to display the last two list items only.
https://jsfiddle.net/5snmggtg/1/
In the provided fiddle, the expected result is "2 3" (currently "1 2").
HTML
<span>
<ul >
<li>1</li> >
<li>2</li> >
<li>3</li>
</ul>
</span>
CSS
li {
display: inline;
}
ul{
position: absolute;
width: 35px;
overflow: hidden;
height: 15px
}