It's all about the CSS properties
margin-left
,
margin-top
,
padding-left
,
padding-top
or their combinations.
The bunch of related concepts you need to understand is called
CSS box model.
You can read how they work here:
http://www.w3.org/TR/CSS2/box.html[
^],
http://www.w3schools.com/css/css_boxmodel.asp[
^].
You can probably get a good idea how it all works at once, if you simply look at the picture shown in the second page referenced above.
—SA