Padding-top

Set the padding on the top 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.

Syntax
      padding-top: 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.

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

#emw3id { padding-top: 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.

“There is but an inch of difference between a cushioned chamber and a padded cell” ~ G. K. Chesterton

Related:

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


Copyright © 2013-2022 Emw3.com
Some rights reserved