J
JWL
Hello
Suppose I have a div containing headings and paragraphs, and I decide to
add some margin or padding to the left side of the div to create some
whitespace. My question is, in this situation, is there any reason
whatsoever to choose padding over margin or vise versa?
<div id="contentcontainer">
<h1>heading</h1>
<p>para</p>
<ul>
<li>list etc.</li>
</ul>
</div>
#contentcontainer {
padding-left: 2em;
/* Or... */
margin-left: 2em; /* ? */
}
Many thanks.
Suppose I have a div containing headings and paragraphs, and I decide to
add some margin or padding to the left side of the div to create some
whitespace. My question is, in this situation, is there any reason
whatsoever to choose padding over margin or vise versa?
<div id="contentcontainer">
<h1>heading</h1>
<p>para</p>
<ul>
<li>list etc.</li>
</ul>
</div>
#contentcontainer {
padding-left: 2em;
/* Or... */
margin-left: 2em; /* ? */
}
Many thanks.