SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot prof_site's Avatar
    Join Date
    Apr 2006
    Location
    Earth
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why does form tag takes extra <p> itself??

    I put a form tag in middle of my layout. Its working fine in firefox but when I see this in IE7, it shows extra space after form tag (like <p>).

    How can I remove this space. Please help me.

    Thanks in advance.

    Profsite
    Are you looking for Poker and Casino Links?
    Visit http://www.cheappokerlinks.com/

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forms have default margins in IE. You can remove those with CSS.
    Code:
    form { margin-top:0; margin-bottom:0; }
    Simon Pieters

  3. #3
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or try and get in the habit from the start of your design by using

    Code:
    * {
         padding: 0px;
         margin: 0px;
    }
    Which will set all margin and padding to zero so that you don't run into the same problem with headers and paragraphs as you can then simply add it where you specifically require it

  4. #4
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by csswiz
    Or try and get in the habit from the start of your design by using

    Code:
    * {
         padding: 0px;
         margin: 0px;
    }
    Which will set all margin and padding to zero so that you don't run into the same problem with headers and paragraphs as you can then simply add it where you specifically require it
    That's not quite such a good idea, as it can screw up the appearance of form elements on certain browsers (and apparently can also slow rendering as it has to walk the entire document tree).

    Better to apply the zero margins/padding to specific elements:
    Code:
    h1, h2, h3, h4, p, ol, ul, dl, form, fieldset, table {
      margin: 0;
      padding: 0;
    }

  5. #5
    SitePoint Wizard bronze trophy DaveWoods's Avatar
    Join Date
    Dec 2004
    Location
    Derbyshire - UK
    Posts
    2,651
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never had any problems with it in respect to appearance in browsers although it can cause some issues with list elements which aren't all that difficult to fix.

    I've not heard about it slowing rendering time though. There's no harm applying zero margin and paddings to each individual element though if you'd prefer to do it that way.

  6. #6
    SitePoint Zealot prof_site's Avatar
    Join Date
    Apr 2006
    Location
    Earth
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Problem Solved.

    Thanks for all of you for your quick response.

    Profsite
    Are you looking for Poker and Casino Links?
    Visit http://www.cheappokerlinks.com/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •