When creating HTML5 and CSS3 designs is it better to primarily use margin and padding for your designs over positioning or the other way around?
I've never really thought about it before and use both side by side to get the results where needed but it's possible to design in both ways as shown in the examples below:
HTML
<div>
<ul>
<li><span>1</span></li>
<li><span>2</span></li>
</ul>
</div>
CSS Example 1 - Using margin, padding
div{
width:1000px;
margin:auto;
}
ul{
margin-left:10px;
width:100px;
}
li{
height:30px;
}
span{
margin-top:10px;
}
CSS Example 2 - Using just positioning (Apart from the margin:auto ..)
div, ul, span{
position:absolute;
}
div{
width:1000px;
margin:auto;
}
ul{
left:10px;
width:100px;
}
li{
height:30px;
}
span{
top:10px;
}