Changes

Jump to: navigation, search

CSS GUIDE PADDING RIGHT

1,985 bytes added, 14:00, 22 November 2006
no edit summary
<span style="margin:0;background:#ffff33;font-size:120%;font-weight:bold;border:1px solid #a3b0bf;text-align:left;color:#000;padding:0.2em 0.4em;">This document is a work in progress and is subject to change.</span><br /><br />
== 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 &lt;div&gt; with a solid border the padding will be outside of the border.

<table border="0">
<tr>
<td><b>Applicability:</b></td><td>The padding-right property can be used for all CSS elements.</td>
</tr>
<tr>
<td><b>[http://developer.mozilla.org/en/docs/CSS:%40media#Media_groups Media Group:]</b>
</td><td>Visual</td>
</tr>
<tr>
<td><b>Inherited:</b></td><td>No</td>
</tr>
</table>

== Syntax ==
<pre>
TARGET_ELEMENT{padding-right: 5px}
TARGET_ELEMENT{padding-right: 3em}
</pre>

== 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 | usage examples]] section for more details.

== Mozilla Recommended Values ==

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

== Notes ==
The [http://www.w3.org World Wide Web Consortium (W3C)] provides a free online [http://jigsaw.w3.org/css-validator/ CSS validation service].

== Specification Conformance ==
*[http://www.w3.org/TR/REC-CSS1#padding-right CSS 1 ]
*[http://www.w3.org/TR/REC-CSS2/box.html#padding-properties CSS 2]
*CSS 3 (specification not yet published)

== Browser Compatibility ==
* Internet Explorer
* Firefox
* Opera

== See Also ==
1
edit

Navigation menu