Set the padding on the left side of an element. Padding is on the inside of the box model while margins are on the outside. Use padding to move the contents away from the edges of the block.

      padding-left: length | inherit ;

length - size of the padding in px, pt, %, em, etc. If a % value is given, this will be based on the width of the containing block.
inherit - inherit from the parent element.

The default value is 0, negative values are not allowed.

h1 { padding-left: 5px; }
.emw3class { padding-left: 1em; }

#emw3id { padding-left: 4pt; }

Try it:

This is a sample of text with a CSS border. The padding on each side of an element can be styled together or separately using CSS.

(CSS 1) Browser Support: All major browsers.

“if you don’t know where you are going, any road will take you there” ~ George Harrison


padding-bottom - Bottom padding of an element.
padding-right - Right padding of an element.
padding-top - Top padding of an element.
padding - Shorthand to set all the padding properties.

Copyright © 2013-2017
Some rights reserved