Get rid of auto-linebreaks after </form>?

Discussion in 'HTML & Website Design' started by Glowing Face Man, Nov 11, 2009.

  1. #1
    Hi,

    It seems like whenever I close a form, a linebreak gets inserted. Is there a way to stop this? I'm trying to set up two buttons next to each other on the same line, one labeled "Reply", one labeled "Quote", using this html:

    <div id='postfoot'>
    
    <form action='post' method='post'>
    <input type='hidden' name='forum' id='forum' value='blah'/>
    <input type='hidden' name='parent' id='parent' value='Ninjas%21%21%21'/>
    <input type='submit' value='Reply'/></form>
    <form action='post' method='post'>
    <input type='hidden' name='forum' id='forum' value='blah'/>
    <input type='hidden' name='parent' id='parent' value='Ninjas%21%21%21'/>
    <input type='hidden' name='quote' id='quote' value='yes'/>
    <input type='submit' value='Quote'/></form>
    </div>
    Code (markup):
    But instead of put the buttons next to each other, Firefox inserts a linebreak between them so one goes on top of the other :p

    How can I get rid of that linebreak? Thanx :)
     
    Glowing Face Man, Nov 11, 2009 IP
  2. sshahnawaz

    sshahnawaz Greenhorn

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    If you use Dreamweaver, you can fix this easily. Just change it in design view and get the code from it.
     
    sshahnawaz, Nov 12, 2009 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    Form elements are block level. Firefox is doing this correctly. Do this:
    form {
      display: inline;
      }
    Code (markup):
    cheers,

    gary
     
    kk5st, Nov 12, 2009 IP
  4. Mark Henderson

    Mark Henderson Well-Known Member

    Messages:
    402
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    110
    #4
    input[type="submit"] {
        display:inline;
    }
    Code (markup):
    Put this in your CSS file or in your HEAD section inside <style></style> tags.

    This will make all your submit buttons go next to each other.
     
    Mark Henderson, Nov 13, 2009 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    Form controls are already inline elements. The OP's issue is two separate forms needing to line up side by side.

    cheers,

    gary
     
    kk5st, Nov 15, 2009 IP