Tutorials Point


  CSS Home

  CSS Reference
  Pseudo Classes & Elements

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

CSS - margin-bottom


previous next AddThis Social Bookmark Button


Advertisements

Description:

The margin-bottom property sets the width of the margin on the bottom of an element.

Possible Values:

  • length: Any length value.
  • percentage: The margin's width is calculated with respect to the width of the element's containing block.
  • auto: Default, Let the browsers automatically set the margin.

Applies to:

All the HTML elements

DOM Syntax:

object.style.marginBottom="5px"

Example:

Here is the example:

<p style="margin-bottom: 15px; border:1px solid black;">
This is a paragraph with a specified bottom margin
</p>

<p style="margin-bottom: 5%; border:1px solid black;">
This is another paragraph with a specified bottom margin in percent
</p>

This will produce following result:

This is a paragraph with a specified bottom margin

This is another paragraph with a specified bottom margin in percent

To Become more comfortable - Do Online Practice



previous next Printer Friendly

Advertisements


  

Advertisements