Why do I get a line break at the end of my forms?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spike

    Why do I get a line break at the end of my forms?

    Hi all

    I have this simple form and every time i vies it there is a line break
    after the button.

    What i want it to look like:

    ----------
    | BUTTON |
    ----------
    Hi



    What it look like

    ----------
    | BUTTON |
    ----------

    Hi

    My code is:

    <form method="POST" action="submit. php">
    <input type="submit" value="Remove">
    </font>
    </form>
    Hi

    Thanks in advance!
  • David Dorward

    #2
    Re: Why do I get a line break at the end of my forms?

    Spike wrote:[color=blue]
    > I have this simple form and every time i vies it there is a line break
    > after the button.[/color]

    Forms are block level elements and as such create line breaks before and
    after themselves by default. You can suggest otherwise by setting the
    display property using CSS. A better option might be to rearrange the
    makup, but you haven't provided enough information to know for sure.
    [color=blue]
    > <form method="POST" action="submit. php">
    > <input type="submit" value="Remove">
    > </font>
    > </form>[/color]

    This markup is invalid, I suggest you make use of http://validator.w3.org/

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Harlan Messinger

      #3
      Re: Why do I get a line break at the end of my forms?


      "Spike" <spikeuk@gmail. com> wrote in message
      news:c181300d.0 411221107.273d0 57f@posting.goo gle.com...[color=blue]
      > Hi all
      >
      > I have this simple form and every time i vies it there is a line break
      > after the button.
      >
      > What i want it to look like:
      >
      > ----------
      > | BUTTON |
      > ----------
      > Hi
      >
      >
      >
      > What it look like
      >
      > ----------
      > | BUTTON |
      > ----------
      >
      > Hi[/color]

      Both these examples have a line break. Otherwise, you'd have

      ----------
      | BUTTON | Hi
      ----------

      What the latter one has is a margin between the form and the following text.
      It's up to the browser what default spacing to use between parts of the
      page. Use CSS to change it, such as

      form { margin-bottom: 0; }

      [color=blue]
      >
      > My code is:
      >
      > <form method="POST" action="submit. php">
      > <input type="submit" value="Remove">
      > </font>
      > </form>
      > Hi
      >[/color]

      Comment

      Working...