Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    207
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Body margins working on IE but not FF

    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" >

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,746
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    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?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    Remove all the quote marks except the starting and stopping ones, too.

  • #4
    Regular Coder
    Join Date
    Jul 2009
    Posts
    207
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by drhowarddrfine View Post
    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.

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,746
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Quote Originally Posted by ketanco View Post

    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;" >
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    Quote Originally Posted by ketanco View Post
    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.

  • #7
    Regular Coder
    Join Date
    Jul 2009
    Posts
    207
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    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?

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,746
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Quote Originally Posted by ketanco View Post
    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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #9
    Regular Coder
    Join Date
    Jul 2009
    Posts
    207
    Thanks
    27
    Thanked 0 Times in 0 Posts
    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

  • #10
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,746
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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