SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Spacing in IE6

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Spacing in IE6

    Hi all...

    Sorry i have nearly finshed a site, then tested it in IE6.....duh!

    Im getting alot of spacing between <p>'s in IE6

    You can view the page here

    Whereas in IE7, Moz and opera it looks fine.

    The css is here

    Note: this is the first time that ive used css throughout, so please be nice!

    Thanks in advance

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I haven't looked at your code (composing a letter right now), but have you tried using a global reset to kill the margins and padding, then adding margins and padding to those elements that require them by any chance?

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dan...

    No, im a bit of a newbie...how is this done?

    b

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At the very top of your CSS code, put in this style rule:

    Code:
    * {
    	margin: 0;
    	padding: 0;
    }
    However, if you have forms on your site (like order forms, for example), then you'll want to use something else instead, like this:

    Code:
    html, body, address, blockquote, div, dl, form, h1, h2, h3, h4, h5, h6, ol, p, pre, table, ul,
    dd, dt, li, tbody, td, tfoot, th, thead, tr, button, del, ins, map, object,
    a, abbr, acronym, b, bdo, big, br, cite, code, dfn, em, i, img, kbd, q, samp, small, span,
    strong, sub, sup, textarea, tt, var {
    	margin: 0;
    	padding: 0;
    }
    Of course, you will have to reset the margins and padding on the elements of your Web page afterword, since these are very powerful style rules. Also note that if you do this, you do not need to explicitly declare margins and padding on some elements to be zero, since they already are.

  5. #5
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Dan for your time...however it hasnt made any difference!

    It looks like its adding extra space below the <p></p> lines.....

  6. #6
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Dan, so its giving <input> 0 margin and padding which ruins the forms? And is that a complete list of Strict HTML elements (other than input?)

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,516
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Remove the opening and closing style tags from your external css file as they are causing IE problems and are invalid in the css file.

    Code:
    <style type="text/css">
    /* commented backslash hack \*/ 
    /* commented backslash hack \*/ 
    
    ...
    </style>
    You can only have css in your css file and css comments - nothing else not even html comments.

    I think you will find that the spacing disappears once you fix that .


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
  •