Margin In CSS

Top Margin

The CSS margin properties define the space around elements. CSS padding properties refer to the white space within the border or we can say that it’s internal spacing. Setting the value of a margin is NOT the same as setting the padding value, and you should always remember that padding & marginare two different properties. …

Top Margin Read More »

Left Margin

Many times we would need to set margin for our objects. This will set the left margin of the object.   Usage: margin-left: 10px; margin-left: 10pt; margin-left: 10%; margin-left: auto;   It takes the following values:   pt: You can set values in points. (e.g: 10pt or 100pt). px: You can set values in pixels. …

Left Margin Read More »

Bottom Margin

Many a times we would need to set margin for our objects. margin-bottom property can be used to set the bottom margin of the object.   Usage: margin-bottom: 10px; margin-bottom: 10pt; margin-bottom: 10%; margin-bottom: auto;   It takes the following values:   pt: You can set values in points. (e.g: 10pt or 100pt). px: You …

Bottom Margin Read More »

Right Margin

Many times we would need to set margin for our objects. margin-right will set the right margin of the object.   Usage: margin-right: 10px; margin-right: 10pt; margin-right: 10%; margin-right: auto;   It takes the following values:   pt: You can set values in points. (e.g: 10pt or 100pt). px: You can set values in pixels. …

Right Margin Read More »