Open main menu

CDOT Wiki β

CSS GUIDE PADDING RIGHT

Revision as of 13:00, 22 November 2006 by Bhearsum (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This document is a work in progress and is subject to change.

Summary

The padding-right elements specifies the padding between an element and a direct sibling of it. Unlike margin, padding is outside of the contents. For example, if you have a <div> with a solid border the padding will be outside of the border.

Applicability:The padding-right property can be used for all CSS elements.
Media Group: Visual
Inherited:No

Syntax

TARGET_ELEMENT{padding-right: 5px}
TARGET_ELEMENT{padding-right: 3em}

Legal Values

The following units are valid for defining padding: cm (centimeters), em (ems), in (inches), mm (millimeters), pc (picas), px (pixels), pt (points), % (percentage of enclosing block level element).

Percentages and ems are the preferred units as they are relative.

See usage examples section for more details.

Mozilla Recommended Values

Usage Examples

p{padding-right: 25%;}  /*Set the right padding to 25% of the enclosing element*/
h1{padding-right: 50px;}  /*Set the right padding to 50 pixels*/
span{padding-right: 2in;}  /*Set the right padding to 2 inches*/

Notes

Specification Conformance

Browser Compatibility

  • Internet Explorer
  • Firefox
  • Opera

See Also