Ezio Shiki
Ezio Shiki

Reputation: 765

Even if I haven't write margin ,there is a strange margin 12px

I'm novice in css.Could you tell me where is the margin 12px come from?enter image description here

Upvotes: 0

Views: 53

Answers (2)

BlackMB
BlackMB

Reputation: 228

it's because you have an conflict in your css code, if you want to have 0 margin in this case, you must call "important" at the end of your 0 margin

Upvotes: -1

Sachin
Sachin

Reputation: 40990

As you can also see that It is coming from user agent stylesheet. Every browser has some css rule for every element which affects the styling.

You can override this value with your own stylesheet as user agent stylesheet as lowest precedence.

p{
  padding:5px;
  margin: 0;
}

Upvotes: 3

Related Questions