Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

twitter bootstrap default padding

Why is this the default padding for twitter bootstrap on the body?

body {
  padding-top: 60px;
  padding-left: 20px;
}

I was under the impression that "reset" css-ish files usually removed all padding/margins.

like image 541
AdamT Avatar asked Nov 14 '22 01:11

AdamT


1 Answers

The padding on the body overrides the the .css files.

As odupont mentioned, "It's useful when you have a navbar navbar-fixed-top at the top of your page"

The padding will set a 20px vertical clearance between the top-fixed positioned nav bar and your document's body. As show in the above code, padding-top: 60px;

40px vertical padding, to clear out the height of the top-fixed nav-bar, that has a 40px height. And then, 20px vertical clearance between the nav-bar and body. So, 60px for the padding-top was declared.

That css thing was inserted in the body for specificity purpose, it overrides whatever padding styling you have in the .css file.

Try to comment the above code, and see the result.

like image 132
GaryP Avatar answered Nov 17 '22 05:11

GaryP