How to decide on using margin or padding in HTML?

Is there a recommended way to use margin and padding in different scenarios in HTML?


  • DavidMDavidM USA
    edited February 2014

    From w3 Schools,

    Explanation of the different parts:

    Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent

    Border - A border that goes around the padding and content. The border is inherited from the color property of the box

    Padding - Clears an area around the content. The padding is affected by the background color of the box

    Content - The content of the box, where text and images appear

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion