HTML DOM right Property
Complete Style Object Reference
Definition and Usage
The right property sets how far the right edge of an element is to the
left/right of the right edge of the parent element.
Syntax
Object.style.right=auto|%|length
|
Possible Values
Value |
Description |
auto |
Lets the browser calculate the right position |
% |
Sets the right position in % from the right edge of
the parent element |
length |
Sets the right position in px, cm, etc. from the
right edge of the parent element. Negative values are allowed |
Tips and Notes
Note: If the "position" property has a value of "static", the "right"
property has no effect.
Example
The following example sets the right edge of an element:
<html>
<head>
<style type="text/css">
input
{
position:absolute;
}
</style>
<script type="text/javascript">
function setRightEdge()
{
document.getElementById("b1").style.right="100px";
}
</script>
</head>
<body>
<input type="button" id="b1" onclick="setRightEdge()"
value="Set right edge to 100 px" />
</body>
</html>
|
Try-It-Yourself Demos
right -
Set right edge of an element
Complete Style Object Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|