</form> adds space to end of file?

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

  1. jodleren

    jodleren Guest


    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:
    echo "</form>";

    Which results in:

    <tr><td colspan=12 align="center">
    &nbsp;<input name="btn_close" type="submit"
    &nbsp;<input name="btn_save" type="submit" value="Save">&nbsp;
    </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.

    jodleren, Nov 26, 2007
    1. Advertisements

  2. jodleren

    Ben C Guest

    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

    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
    1. Advertisements

  3. jodleren

    Els Guest

    Set this in your stylesheet:
    Els, Nov 26, 2007
  4. jodleren

    Els Guest


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

    jodleren Guest

    Thanks, that helped

    jodleren, Nov 26, 2007
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.