I found the code for a dropdown here on stackoverflow and was playing with it.
Please take a look at the following jsfiddle -
- The first menu -
.menuis a normal dropdown menu that I found on SO. - The second one -
.menu2has been modified by me.
When I remove position:relative from -
.menu ul li {
display: block;
position: relative;
float: left;
}
and remove float:none -
.menu li:hover li {
float: none;
font-size: 11px;
}
from .menu I get the .menu2 which shows the dropdown in a horizontal manner.
I'm unable to understand why. I would assume that simply removing float:none would have made the li appear side by side, but we have to remove position:relative as well to achieve that effect. Why is that?