Wednesday, 15 May 2013

html - Padding property doesn't add spacing -



html - Padding property doesn't add spacing -

i recently realised padding property adds spacing between content , border of content. testing property when discovered instance padding doesn't add together spacing.

i have paragraph

<p>some text</p>

and styling

p { background: red; color: white; border: dashed 2px blue; margin-left: 44px }

result (jsfiddle)

add together padding: 49px css. logically, shoud but obtain (jsfiddle) can see, text moves, reddish spacing isn't added. why?

ps : maybe express myself badly, i'm sorry it

you have margin-left. difference between margins , paddings.

remove it:

css

p { background: red; color: white; border: dashed 2px blue; padding-left: 49px }

in fiddle

no more space :)

html css padding

No comments:

Post a Comment