Login | Register | FAQ
Anonymous

CSS Padding

+ Post a reply

3 posts Page 1 of 1


CSS Padding

by chrisf1288 » Sun Jun 26, 2011 1:27 am

I am having a little bit of trouble figuring out CSS padding. I post a code like:

body {
margin-top: 100px;
margin-right: 40px;
margin-bottom: 10px;
margin-left: 70px;
}

in my stylesheet and it works perfectly for watever.. But when I try posting the same code in another part of my stylesheet, its all f'ed up, like only the first line of the text actually moves for the padding. Is there something i'm missing or doing wrong? Please help :(
User avatar

chrisf1288

  • Posts: 128
  • Joined: Sun Jun 26, 2011 1:01 am

Re: CSS Padding

by HTML.net » Sun Jun 26, 2011 8:01 am

CubeSquare is right, the code is perfect. And it should work fine at the body as well. It must something else in your stylesheet that gives the problems.

Try to upload it here or post a link.

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1194
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: CSS Padding

by nikolaydyankov » Fri Jul 08, 2011 10:26 am

Just a tip - you can specify different margin on every side with just one line of code, like this:

Code: Select all
margin: <top> <right> <bottom> <left>;


For example in your case:

Code: Select all
margin: 100px 40px 10px 70px;


Cheers!
User avatar

nikolaydyankov

  • Posts: 3
  • Joined: Sat Jun 11, 2011 1:07 pm
--
Video tutorials on web development by me:
YouTube: http://www.youtube.com/user/NikolayDyankov

@nikolay_dyankov


+ Post a reply

Page 1 of 1