user2939345 user2939345 - 2 years ago 136
HTML Question

Floating divs in list (Google Chrome)

I need two divs to be next to eachother in a list. The following code works fine in Firefox, but not in Google Chrome:

<div style="float:left;">DIV 1</div>
<div>DIV 2</div>

See the bullet position in Google Chrome:

Bullet position in Google Chomre

What am I doing wrong?

Answer Source

Rather than using float:left; use display:inline-block; on both div's. That will allow them to be in the same line. Here's an updated Fiddle showing that:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download