Jitendra Vyas
Jitendra Vyas

Reputation: 152677

Should we always keep same value for body {font-size:...} which we want to use content <p>?

What are pros and cons to define font-size for body?

what if somewhere i will need font smaller and bigger than body?

will i get body font size (12px) + needed font size for <p> (10px) = 22

Should we always keep same value for body font size which we want to use content paragraph?

Upvotes: 1

Views: 107

Answers (2)

Christopher
Christopher

Reputation: 10627

I defined it right in the body, and just override it by tag or class where appropriate. I don't see any problem defining a "default" font-size on the body.

Upvotes: 0

Delan Azabani
Delan Azabani

Reputation: 81384

  1. It's good to define a global value, that changes relatively (em) or absolutely (px) when needed.
  2. No, the pixel values won't add up. However, if body is defined as 12px and p is defined as 2em (a relative unit), then p will be 24px.
  3. Again, it's good to define base globals so values are easier to predict.

Upvotes: 2

Related Questions