Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Information on how to use margins

I need some info on how to use margins and how exactly padding works.

For example: Should I put a line to occupy the whole width of the page (no matter what resolution is used to display the web page) letting just a small border on each side, how could I achieve this?

like image 934
Layla Avatar asked Feb 03 '26 21:02

Layla


1 Answers

Have a look at this: http://redmelon.net/tstme/box_model/

Basically, an element consists of content, surrounded by its padding, then the border, then the margin. Background images only extend as far as the border. Margins are best described as 'the whitespace around this element'.

But have a look at the URL above, and make yourself a test page to have a play with, it should all make sense.

like image 199
Dan Avatar answered Feb 06 '26 12:02

Dan