How to flush a drop-down menu next to an image?

Discussion in 'Web Design and Development' started by macaddict23, Feb 22, 2008.

  1. macaddict23 macrumors 6502

    macaddict23

    Joined:
    Jun 20, 2006
    Location:
    MacVille, USA
    #1
    I have a 100px x 20px image. I want to place a drop down menu to the right of this image. But right now, the drop down wraps under the image.

    Here's a sample code:

    <img src="myimage.jpg">
    <form id="form2" name="form2" method="post" action="">
    <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
    <option>Find a Dealer</option>
    <option value="#">Dealer 1</option>
    <option value="#">Dealer 2</option>
    <option value="#">Dealer 3</option>
    </select>
    </form>
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    My first thought is that it's the form. The form tag is a block element so there's a new line before and after it. Use CSS to make the form inline.

    Code:
    #form2 {
     display: inline;
    }
     
  3. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #3
    And my first thought is

    Code:
    img {float: left;}
    #form2 {float: left; margin: 0 10px 0 0;}
     

Share This Page