I would like to list links in a single line and hide anything that does not fit within browser width. In the end I would like to have a single div that is always on top of overflowing links. How can I achieve this?
Here’s demo on dablet.com, resize the browser window to see what I mean.
HTML markup:
<div class="bar">
<a href="">item</a>
…
<a href="">item</a>
<a href="">item</a>
<div class="more">
<a href="">more items...</a>
</div>
</div>
CSS styles:
.bar {
font-size: 12px;
height: 16px;
margin: 0 0 5px;
overflow:hidden;
}
.bar a:link,
.bar a:visited {
background-color: #b3d4ae;
border-radius: 5px;
color: #003300;
padding: 0 3px 15px 3px;
}
.more {
float: right;
}
The result is: (demo on dabblet.com)
I change list of anchors in your markup to
ulit is more semantic and good practice in web developmentHTML markup:
CSS styles: