what is the padding's role on the css and html -
this question has answer here:
- when use margin vs padding in css 16 answers
i use sytle padding script
like this
<style> #img1{padding:7px 10px} </style> <body> <img src="myjpg.jpg" id="img1"/> </body>
i can't understand exactely role of padding.
maybe padding's function object's out layer margin??
as can see in image (shared josh) :
say have element c parent p.
- padding : when applied p, adds space inside p, outside c.
- padding : when applied c, adds space inside c.
- margin : when applied c, adds space outside c, inside p.
- margin : when applied p, adds space outside p, inside p's parent.
you may notice 1st & 3rd case alike when p & c considered.
Comments
Post a Comment