Style Object paddingTop Property
Style Object
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
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 »
|
Style Object
Stylus Studio® 2010 XML Enterprise Suite raises the bar for productivity in XML development tools.
Millions of XML developers and data integration specialists turn to Stylus Studio's comprehensive and intuitive
XML toolset to tackle today's advanced XML data transformation and aggregation challenges.
|
- XML Pipeline Editor, Debugger and Code Generator
- DataDirect XML Converters
- XQuery Mapper, Editor, Debugger, and Profiler
- XSLT Mapper, Editor, Debugger, Designer, and Profiler
- Java and C# for .Net Code Generation
- XML Schema Designer With Documentation Generator
- XML Editor With Full XPath Integration
Download a free trial now
|
|