...

View Full Version : Body margins working on IE but not FF



ketanco
11-03-2009, 03:40 PM
Hello, the margins work for IE for the code below, but not for FF. See www.robotbuy.com/index3 Please advise...

<body style="background:url(http://www.robotbuy.com/pictures/main_bg.png);" leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" >

Excavator
11-03-2009, 04:06 PM
Good morning ketanco,
Your inline style you quote isn't going to do anything, it's invalid.
Could be margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;
Or, much easier margin: 0;

Either way, I'm not seeing any difference between IE8 and FF here. Could you explain what your expecting that code to do?

drhowarddrfine
11-03-2009, 04:08 PM
Remove all the quote marks except the starting and stopping ones, too.

ketanco
11-03-2009, 04:25 PM
Remove all the quote marks except the starting and stopping ones, too.
You mean this?:
<body style="background:url(http://www.robotbuy.com/pictures/main_bg.png); leftmargin=0 topmargin=0 bottommargin=0 rightmargin=0" >

This didnt work either.

excavator what you suggested also didnt work. What I am trying to do is to position the main wrapper div on the screen. if I use the code I wrote, for IE it worked and it was zero margin from top and left, which I wanted but with FF there remained a gap.

Excavator
11-03-2009, 04:32 PM
excavator what you suggested also didnt work. What I am trying to do is to position the main wrapper div on the screen. if I use the code I wrote, for IE it worked and it was zero margin from top and left, which I wanted but with FF there remained a gap.

Much easier when you explain what your trying to do instead of just saying it's not working!

Put this line at the top of your css.css - body {margin: 0;}
Or change your inline style to look like this - <body style="background:url(http://www.robotbuy.com/pictures/main_bg.png); margin:0;" >

drhowarddrfine
11-03-2009, 06:24 PM
You mean this?:
<body style="background:url(http://www.robotbuy.com/pictures/main_bg.png); leftmargin=0 topmargin=0 bottommargin=0 rightmargin=0" >

This didnt work either.

Because you're still using those margin attributes. There is no such thing as those. Remove them and use the ones Excavator showed you.

ketanco
11-03-2009, 07:11 PM
Much easier when you explain what your trying to do instead of just saying it's not working!

Put this line at the top of your css.css - body {margin: 0;}
Or change your inline style to look like this - <body style="background:url(http://www.robotbuy.com/pictures/main_bg.png); margin:0;" >

okay this works now thanks. one question though. although margin:0 value is okay for me, i tried it with 40 and it just got may be 10 pixels away from top and left but not 40. why might that be?

Excavator
11-03-2009, 07:48 PM
okay this works now thanks. one question though. although margin:0 value is okay for me, i tried it with 40 and it just got may be 10 pixels away from top and left but not 40. why might that be?

Did you do margin:40; or margin:40px; ? Again, showing us what your doing makes it a lot easier than trying to guess what you've done. We're not psychic you know - show us the code that's not working.

ketanco
11-03-2009, 07:51 PM
it works now... resolved...i did that with giving margin to the main div...
by the way what is the difference between margin 40 and margin 40 px?
thanks

Excavator
11-03-2009, 07:54 PM
margin:40; is invalid because there is no measurement unit specified.

margin:40px; works because we've told the browser to use pixel units.

A lot of new coders make that mistake, I was just guessing that you might have as well.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum