HTML DOM top Property
Complete Style Object Reference
Definition and Usage
The top property sets how far the top edge of an element is above/below the
top edge of the parent element.
Syntax
Object.style.top=auto|%|length
|
Possible Values
Value |
Description |
auto |
Lets the browser calculate the top position |
% |
Sets the top position in % from the top edge of
the parent element |
length |
Sets the top position in px, cm, etc. from the
top edge of the parent element. Negative values are allowed |
Tips and Notes
Note: If the "position" property has a value of "static", the "top"
property has no effect.
Example
The following example sets the top edge of an element:
<html>
<head>
<style type="text/css">
input
{
position:absolute;
}
</style>
<script type="text/javascript">
function setTopEdge()
{
document.getElementById("b1").style.top="100px";
}
</script>
</head>
<body>
<input type="button" id="b1" onclick="setTopEdge()"
value="Set top edge to 100 px" />
</body>
</html>
|
Try-It-Yourself Demos
top - Set
top edge of an element
Complete Style Object Reference
Learn how your website performs under various load conditions
|
|
WAPT
is a load, stress and performance testing tool for websites and web-based applications.
In contrast to "800-pound gorilla" load testing tools, it is designed to minimize the learning
curve and give you an ability to create a heavy load from a regular workstation.
WAPT is able to generate up to 3000 simultaneously acting virtual users using standard hardware configuration.
Virtual users in each profile are fully customizable. Basic and NTLM authentication methods are supported.
Graphs and reports are shown in real-time at different levels of detail, thus helping to manage the testing process.
Download the free 30-day trial!
|
|