padding

英[ˈpædɪŋ] 美[ˈpædɪŋ]

n.Padding; lining; redundant language; nonsense

v. To pad..., to add cushions (the present participle of pad); to walk, to walk lightly

left

英[left] 美[lɛft]

adj.Left, left; leftist

n.Left, left;[military] left wing;left wing, radical

adv.To the left; on the left

v.Leave (past tense and past participle of leave)

Plural: lefts

javascript paddingLeft property syntax

Function: Set the left padding of the element. Defines the space between the element's border and its content.

Syntax: Object.style.paddingLeft=length|%

javascript paddingLeft property example

<html>
<head>
<style type="text/css">
p
{ 
border: thin dotted #FF0000;
}
</style>
<script type="text/javascript">
function changePadding()
{
document.getElementById("p1").style.paddingLeft="2cm";
}
</script>
</head>
<body>

<input type="button" onclick="changePadding()"
value="Change left padding" />

<p id="p1">This is a paragraph</p>

</body>
</html>

Run instance »

Click the "Run instance" button to view the online instance