Javascript examples for CSS Style Property:outlineWidth
The outlineWidth property sets or gets the width of the outline.
Value | Description |
---|---|
thin | thin 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. |
Item | Value |
---|---|
Default Value: | medium? |
Return Value: | A String, representing the width of an element's outline |
CSS Version | CSS2 |
Change the width of the outline of a <div> element:
<!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>