-
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
-
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?
-
Hi Dan...
No, im a bit of a newbie...how is this done?
b
-
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. :)
-
Thanks Dan for your time...however it hasnt made any difference!
It looks like its adding extra space below the <p></p> lines.....
-
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?)
-
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 :).