Log in

View Full Version : Default top margin, 1px difference in Firefox & IE



Jay661
02-16-2009, 08:09 PM
Hi,

First post on here!

...I have a problem with the default margin in IE being 1px less than Firefox. I've stripped my CSS down to be as naked as possible!

It's quite frustrating as I'm quite experienced with CSS, I guess the small silly things do things like this when you've not been CSS'n for a few months!

HTML:- (Just the typical HTML you start with)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>

test

</body>
</html>



CSS:-

* { margin: 0; padding: 0; }
body { margin: 0; padding: 0; }

Snookerman
02-16-2009, 08:51 PM
I've stripped my CSS down to be as naked as possible!
:D You sure did! There's not really anything to work with. Could you post a link to your site or give us more code?

Jay661
02-16-2009, 08:55 PM
haha... incase that got mis-understood, I stripped the CSS down and it STILL gives the 1px extra problem with the code you see. I've attached the .html and .css into a .ZIP incase any of you want to have a play with it.

Thanks for the fast response as well! :)

...by the way, I currently don't have a domain registered to upload this to.

Snookerman
02-16-2009, 09:52 PM
I'm sorry but I see no difference in margin and looking at the code I shouldn't since it's all fine. What version of Fx and IE are you using? Could you also please post a screenshot showing the difference?

Jay661
02-18-2009, 03:37 PM
Sorry for taking so long to reply to my own thread! I've done a tiny bit more coding to see if it would sort itself out, I updated Firefox and IE to the latest versions, I've also tested the code on a completely different PC with the same and different versions of IE and Firefox and the results are all the same...

I've attached the code so far along with a small screenshot of the difference... but please note, even though there's some extra code chucked in there it doesn't affect it by the looks of it as I've tried it with next to no code!

I could be pikey and use the expression('') hack to fix it in IE, but I'm too in love with valid CSS! :))

The gap just won't go!

Thanks