HTML DOM paddingTop Property
Complete Style Object Reference
Definition and Usage
The paddingTop property sets the top padding of an element.
The padding properties define the space between the element border and the
element content.
Syntax
Object.style.paddingTop=length|%
|
Possible Values
Value |
Description |
length |
Defines a fixed top padding |
% |
Defines a top padding in % of the total height of the
document |
Example
The following example changes the top padding between a paragraph and its
border:
<html>
<head>
<style type="text/css">
p
{
border: thin dotted #FF0000;
}
</style>
<script type="text/javascript">
function changePadding()
{
document.getElementById("p1").style.paddingTop="2cm";
}
</script>
</head>
<body>
<input type="button" onclick="changePadding()"
value="Change top padding" />
<p id="p1">This is a paragraph</p>
</body>
</html>
|
Try-It-Yourself Demos
paddingTop - Change the top padding between a paragraph and its border
Complete Style Object Reference
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|