write display:inline-block
instead of float:left
.
li {
display:inline-block;
*display:inline; /*IE7*/
*zoom:1; /*IE7*/
background:blue;
color:white;
margin-right:10px;
}
http://jsfiddle.net/3Ezx2/3/
More Related Contents:
- elements are not centered aligned inside the wrapper and when I set the width of the wrapper it goes out of the browser width..any solution?
- How can I center text (horizontally and vertically) inside a div block?
- Why not use tables for layout in HTML? [closed]
- How do I auto-resize an image to fit a ‘div’ container?
- How can I position my div at the bottom of its container?
- Can I create a div with a Curved bottom?
- Make CSS Hover state remain after “unhovering”
- How to make a HTML Page in A4 paper size page(s)?
- How do I not underline an element in a link?
- Best Practices & Considerations when writing HTML Emails [closed]
- Is there a way to style part of an input field’s value? [duplicate]
- How can I correctly select the first or the last child with CSS?
- Add border-bottom to table row
- How to set maximum height for table-cell?
- How does this CSS produce a circle?
- CSS fixed width in a span
- Chrome rendering issue. Fixed position anchor with UL in body
- Change last letter color
- Why is an element with position: fixed moving with a non-positioned sibling?
- Can a dynamic class be styled using CSS? [duplicate]
- CSS filter:invert not working with background-color
- Empty vertical space between columns in Bootstrap 4
- Select second last element with css
- Css transition from display none to display block, navigation with subnav [duplicate]
- Apply CSS Style on all elements except with a SPECIFIC ID
- Is there a way to get a textarea to stretch to fit its content without using PHP or JavaScript?
- Select option padding not working in chrome
- How to make bootstrap carousel image responsive?
- Background-Color of BODY tag applied to the whole HTML [duplicate]
- How to get horizontal scroll bar in select box in IE?