I would like to make a horizontal menu. I have a unordered list (ul
) with three list elements (li
). The list elements are forced to be in one line with display: inline-block;
.
I like to get a margin of 5% on the left and the right side of the menu. Between the list elements, i have a margin of 1.5%.
margin-left (5%)
Element 1 (29%)
margin-right (1%)
margin-left (0.5%)
Element 2 (29%)
margin-right (0.5%)
margin-left (1%)
Element 3 (29%)
margin-right (5%)
If i add up all the percentages, I get 100%.
5 + 29 + 1 + 0.5 + 29 + 0.5 + 1 + 29 + 5 = 100
But unfortunately, the line breaks.
Following a example: http://jsfiddle.net/8U5hM/2/
Thanks for hints!