This is driving me crazy. I have an horizontal menu that is an ul
with many li
elements inside. The li
elements contain img
elements that are links. I want the menu to be as wide as possible, proportionally maintaining its entire ratio. Resizing the page should proportionally resize the menu as well.
How it is now ---> How it should be
I've tried a lot of stuff, but couldn't find anything that works. This is my current, horrible, CSS:
#container {
display: inline;
padding: 0 0;
margin: 0 0;height: 20px;
display: block;
}
#container ul {
display: inline;
list-style: none;
white-space: nowrap;
padding: 0 0;
margin: 0 0;
height: 100%;
width: auto;
}
#container ul li {
display: inline;
list-style-type: none;
padding: 0 0;
margin: 0 0;
float: left;
height: inherit;
max-width: 100%
}
#container ul li img {
height:100%;
max-width: 100%
}