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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    85
    Thanks
    3
    Thanked 0 Times in 0 Posts

    All browser body margins/padding

    Hi there,

    I am working on a site. I origonally was declaring a "body" style in my css, but soon realised that i also need to declare a "html" style to correct something in opera. But now my margins are screwy in everything except IE. Following are the css for my body and html style tags. Can someone please tell me where the best place to set my margins/padding within these two style tags so that I have a 10pixel margin (or) padding on the top and bottom of the site.

    Code:
    html {
    	height: 100%;
    	margin: 0px, 0px, 0px, 0px;
    	padding: 10px, 0px, 10px, 0px;
    	}
    
    body {
    	height: 100%;
    	background-color: #AAAAAA;
    	text-align: center;
    	}

    Would really appreciate it if someone could help me!

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    For shorthand CSS properties, you separate each value by a space and not by a comma.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    85
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for the heads up on the commas. Updated css is:

    Code:
    html {
    	height: 100%;
    	margin: 0px 0px 0px 0px;
    	padding: 10px 0px 10px 0px;
    	}
    
    body {
    	height: 100%;
    	background-color: #AAAAAA;
    	text-align: center;
    	}
    however, this still isn't bearing any fruit in terms of the correct margins/padding. There is always a top margin, but on firefox, netscape and opera, the site is without a bottom border. Any suggestions?


  •  

    Posting Permissions

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