outlineWidth Property - Javascript CSS Style Property

Javascript examples for CSS Style Property:outlineWidth

Description

The outlineWidth property sets or gets the width of the outline.

Property Values

Value Description
thinthin outline
medium medium outline. Default
thick thick outline
length The width of the outline in length units
initial Sets this property to its default value.
inherit Inherits this property from its parent element.

Technical Details

Item Value
Default Value: medium?
Return Value: A String, representing the width of an element's outline
CSS VersionCSS2

Change the width of the outline of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {/* w ww  .j  av a2s . c o  m*/
    border: 1px solid red;
    outline: dotted green;
}
</style>
</head>
<body>

<div id="myDiv" style="outline-width:10px;">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">test</button>

<script>
function myFunction() {
    document.getElementById("myDiv").style.outlineWidth = '5px';
}
</script>

</body>
</html>

Related Tutorials