Google+ logo Twitter logo Youtube logo

Padding and margin

Padding and margin

Very often you want to push text a bit from the side. In the example (down here) we're gonna introduce two new properties; padding and margin.

Both properties are ment for intendation. Simplyfied; padding is applied inside the HTML element and margin is applied outside the HTML element.

A block
A div is pretty much a block
just another block!

In the example above we can see that the margin is applied outside the HTML element, were the padding is applied inside the HTML element.

Padding and margin can also be applied at just one side of the element. say; we want the text to be intended, it could be done like this;

In this example the text is intended 25 pixels from the left-side. This method can also be applied for the other sides; top, right and bottom.

Here's an overview of the possibilities;

Property Possible value Explanation
padding examples: 10px, 23px, 1000px Indentation at the inside of the element
margin examples: 10px, 23px, 1000px Indentation at the outside of the element
padding-left same as above Padding but then only applied at the left side. This method can also be used with the other "sides"; padding-right, padding-top, padding-bottom
margin-left idem dito Margin but then only applied at the left side. This method can also be used with the other "sides"; margin-right, margin-top, margin-bottom

Comments (17) Post comment

  • Direct url Patrickhib (August 22, 2021 @ 11:15)
  • Direct url UkuKD (July 19, 2021 @ 10:43)
    \r\n<a href=\"\">can i get trazodone</a> \r\n
  • Direct url NiaNA (June 1, 2021 @ 11:52)
    Drug prescribing information. Cautions. \r\n<a href=\"\">where to buy cheap depakote without prescription</a> in Canada \r\nActual trends of medication. Get here.
  • Direct url YosJE (May 17, 2021 @ 06:36)
    cialis strength <a href=\"\">where to buy cialis</a> cialis cheapest price
  • Direct url SbtAE (May 16, 2021 @ 03:55)
    is cialis generic <a href=\"\">maxim peptide tadalafil</a> cialis side effect
  • Direct url IraZQ (May 16, 2021 @ 02:06)
    otc viagra <a href=\"\">viagra lyrics</a> sildenafil 100mg price
  • Direct url OrzRQ (May 14, 2021 @ 06:41)
    buy viagra online <a href=\"\">sildenafil</a> sildenafil citrate 20 mg
  • Direct url GlmMA (May 13, 2021 @ 08:32)
    best resume writing service <a href=\"\">education resume</a> cover letter definition
  • Direct url Kathrynpem (May 12, 2021 @ 14:12)
    cialis canada <a href=\"\">generic cialis india</a> how much does cialis cost
  • Direct url HwfSW (May 12, 2021 @ 08:00)
    cover letter salutation <a href=\"\">experience resume</a> keywords for resume
  • Direct url Martinapiepe (May 8, 2021 @ 01:48)
    viagra 100 mg <a href=\"\">female viagra sildenafil</a> natural viagra recipe
  • Direct url Francesisoft (May 7, 2021 @ 12:23)
    discount viagra <a href=\"\">viagra canada</a> cvs viagra
  • Direct url Rebeccagiz (May 7, 2021 @ 03:50)
    essay service dubai <a href=\"\">essay writing website</a> essay cheap service online
  • Direct url StellaAnach (May 5, 2021 @ 11:33)
    how to write an advertisement analysis essay <a href=\"\">write my essay com</a> how to write a volunteer essay
  • Direct url TiffanyNon (May 3, 2021 @ 18:43)
    cialis precio <a href=\"\">cialis for daily use</a> cialis buy
  • Direct url JaniceCak (April 30, 2021 @ 14:26)
    cialis over the counter <a href=\"\">no prescription cialis</a> cheapest cialis 20 mg
  • Direct url CjeNT (April 26, 2021 @ 13:36)
    Drug prescribing information. Long-Term Effects. \r\n<a href=\"\">where can i buy lyrica</a> in US \r\nBest what you want to know about medicines. Read information now.

Leave a comment ...

Name (will be visible)
E-mailaddress (will not be shown)
Type the code illustrated below

Back to top