document.ids.paddingRight

JavaScript 1.2+ Nav4+ Syntax

document.ids.idName.paddingRight

Description

The paddingRight property specifies the distance between the right border of an element and its content. Using dot notation, the property is associated with the ID called idName.

Example

Listing 7.130 uses the paddingRight property to set the distance between a line of text and its border.

Listing 7.130 Set the Right Padding with the paddingRight Property
<html>

<script>
<!-- Hide

//Create a style sheet id that defines the right padding
document.classes.FORMAT.all.borderWidths(10)
document.ids.PAD.paddingRight = "40";

//Hide End --->
</script>

<p class=FORMAT id=PAD>This text has extra padding on the right.</p>

</html>
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.