</form> adds space to end of file?

Discussion in 'HTML' started by jodleren, Nov 26, 2007.

  1. jodleren

    jodleren Guest

    Hi!

    I have a "problem", that in to tables (cascaded), that </form> adds /
    takes up space at the end of my file....

    in PHP, I have:
    </table><?php
    }
    echo "</form>";

    Which results in:

    <tr><td colspan=12 align="center">
    &nbsp;<input name="btn_close" type="submit"
    value="Cancel">&nbsp;&nbsp;&nbsp;
    &nbsp;<input name="btn_save" type="submit" value="Save">&nbsp;
    </td></tr>
    </table></form></td><td width=5></td></tr>

    Removing the </form> and it takes up less space... I have a feeling
    that it is this specific file, but I cannto figure what causes it.

    WBR
    Sonnich
    jodleren, Nov 26, 2007
    #1
    1. Advertising

  2. jodleren

    Ben C Guest

    On 2007-11-26, jodleren <> wrote:
    > Hi!
    >
    > I have a "problem", that in to tables (cascaded), that </form> adds /
    > takes up space at the end of my file....
    >
    > in PHP, I have:
    ></table><?php
    > }
    > echo "</form>";
    >
    > Which results in:
    >
    > <tr><td colspan=12 align="center">
    > &nbsp;<input name="btn_close" type="submit"
    > value="Cancel">&nbsp;&nbsp;&nbsp;
    > &nbsp;<input name="btn_save" type="submit" value="Save">&nbsp;
    > </td></tr>
    > </table></form></td><td width=5></td></tr>
    >
    > Removing the </form> and it takes up less space... I have a feeling
    > that it is this specific file, but I cannto figure what causes it.


    It is probably the default bottom margin of 1em on form applied by many
    browsers in quirks mode (although some do it whether in quirks mode or
    not).

    Leave the </form> in (assuming there is a corresponding <form>,
    validate the HTML to be sure).

    Set form { margin-bottom: 0 } in the styles, e.g. by using <form
    style="margin-bottom: 0"> at the point of opening it, although using
    external stylesheets is usually a better way to organize your styles.

    Don't be tempted to leave </form> out. You may get the display you want
    but you're relying on how browsers heuristically patch up invalid
    markup, which is risky and likely to bite you later.
    Ben C, Nov 26, 2007
    #2
    1. Advertising

  3. jodleren

    Els Guest

    jodleren wrote:

    > I have a "problem", that in to tables (cascaded), that </form> adds /
    > takes up space at the end of my file....


    Set this in your stylesheet:
    form{margin-bottom:0;}

    --
    Els http://locusmeus.com/
    Els, Nov 26, 2007
    #3
  4. jodleren

    Els Guest

    Ben C wrote:

    > It is probably the default bottom margin of 1em on form applied by many
    > browsers in quirks mode (although some do it whether in quirks mode or
    > not).


    [snip]

    Oops, sorry Ben, didn't see your reply before I wrote mine. Yours is
    complete enough not to add to it :)


    --
    Els http://locusmeus.com/
    Els, Nov 26, 2007
    #4
  5. jodleren

    jodleren Guest

    On Nov 26, 10:55 am, Ben C <> wrote:
    > On 2007-11-26, jodleren <> wrote:


    >
    > Set form { margin-bottom: 0 } in the styles, e.g. by using <form
    > style="margin-bottom: 0"> at the point of opening it, although using
    > external stylesheets is usually a better way to organize your styles.
    >
    > Don't be tempted to leave </form> out. You may get the display you want
    > but you're relying on how browsers heuristically patch up invalid
    > markup, which is risky and likely to bite you later.- Hide quoted text -


    Thanks, that helped

    WBR
    Sonnich
    jodleren, Nov 26, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shuo Xiang

    Stack space, global space, heap space

    Shuo Xiang, Jul 9, 2003, in forum: C Programming
    Replies:
    10
    Views:
    2,855
    Bryan Bullard
    Jul 11, 2003
  2. Tobiah
    Replies:
    5
    Views:
    316
    Erik Max Francis
    Sep 16, 2003
  3. Christian Seberino
    Replies:
    21
    Views:
    1,620
    Stephen Horne
    Oct 27, 2003
  4. Ian Bicking
    Replies:
    2
    Views:
    975
    Steve Lamb
    Oct 23, 2003
  5. Ian Bicking
    Replies:
    2
    Views:
    702
    Michael Hudson
    Oct 24, 2003
Loading...

Share This Page