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 5 of 5

Thread: margins

  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    margins

    I know html and am trying to learn php and css. I want to get away from the old
    <body bgcolor="#000000"> and use styles. I am having trouble figuring out ho to do margins this way. I want know margin, yes I have a reason. Can anyone help. Below is what I am trying to do.

    <body style="background:#FFFFFF;margin-left=0cm">

  • #2
    New Coder
    Join Date
    Nov 2005
    Location
    Central Indiana
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't use "=" operator in a stylesheet =]

    Instead of margin-left=0cm you want

    margin-left: 0cm (or px or em or whatever units you're using);

  • #3
    Regular Coder Graft-Creative's Avatar
    Join Date
    Aug 2004
    Location
    Web Designer - North East Lancashire U.K.
    Posts
    842
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ajthornton
    <body style="background:#FFFFFF;margin-left=0cm">
    Simple:
    Code:
    body {
    background:#fff;
    margin-left: 0;
    }
    No need to declare units on the 0: 0 is 0 anyway.

    Gary

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ajthornton
    <body style="background:#FFFFFF;margin-left=0cm">
    Using inline styles pretty much stops CSS being as useful as it should be. As Graft-Creative suggested, placing the CSS in an external file would be much more beneficial.

  • #5
    New Coder
    Join Date
    Nov 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, that helps a lot


  •  

    Posting Permissions

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