HTML DOM borderTop Property
Complete Style Object Reference
Definition and Usage
The borderTop property sets all properties for the top border in one
declaration.
Syntax
Object.style.borderTop=borderWidth borderStyle borderColor
|
Possible Values
| Value |
Description |
Values |
| borderWidth |
Sets the width of the border |
thin
medium
thick
length |
| borderStyle |
Sets the style of the border |
none
hidden
dotted
dashed
solid
double
groove
ridge
inset
outset |
| borderColor |
Sets the color of the border |
color-name
color-rgb
color-hex
transparent |
Example
The following example changes the width, style, and color of the top border:
<html>
<head>
<style type="text/css">
p
{
border: thin dotted #FF0000
}
</style>
<script type="text/javascript">
function changeBorder()
{
document.getElementById("p1").style.borderTop="thick solid #0000FF";
}
</script>
</head>
<body>
<input type="button" onclick="changeBorder()"
value="Change top border" />
<p id="p1">This is a paragraph</p>
</body>
</html>
|
Try-It-Yourself Demos
borderTop - Change width, style, and color of the top border
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!
|
|