Found 10483 Articles for Web Development

How to set the width of the outline around an element with JavaScript?

Swarali Sree
Updated on 23-Jun-2020 13:36:14

147 Views

To set the outline width, use the outlineWidth property. You can try to run the following code to set the width of the outline around an element with JavaScript −ExampleLive Demo                    #box {             width: 450px;             background-color: orange;             border: 3px solid red;             margin-left: 20px;          }                     Click below to add Outline Width. ... Read More

How to set the color of the outline around an element with JavaScript?

Vikyath Ram
Updated on 24-Jan-2020 06:47:38

157 Views

To set the outline color, use the outlineColor property. You can try to run the following code to set the color of the outline around an element with JavaScript:ExampleLive Demo                    #box {             width: 450px;             background-color: orange;             border: 3px solid red;          }                     Click below to add Outline Color.                This ... Read More

How to offset an outline and draw it beyond the border edge with JavaScript?

Sai Subramanyam
Updated on 30-Jul-2019 22:30:21

211 Views

To offset an outline, use the outlineOffsetproperty. It allows you to draw the outline beyond the border edge. You can try to run the following code to offset an outline and draw it beyond the border edge with JavaScript. Example Live Demo #box { width: 450px; background-color: orange; ... Read More

How to set all the outline properties in one declaration with JavaScript?

Monica Mona
Updated on 23-Jun-2020 13:23:32

159 Views

To set outline properties, use the outline property. It allows you to set the color, style, and offset of the outline.ExampleYou can try to run the following code to set all the outline properties in one declaration with JavaScript −Live Demo                    #box {             width: 450px;             background-color: orange;             border: 3px solid red;          }                     Click below to add ... Read More

How to set the opacity level for an element with JavaScript?

Sharon Christine
Updated on 23-Jun-2020 13:27:01

784 Views

Use the opacity property in JavaScript to set the opacity level. You can try to run the following code to set the opacity level for an element with JavaScript −ExampleLive Demo                    #box {             width: 450px;             background-color: gray;          }                     Click below to set Opacity.       Set Opacity                This is a div. This is a ... Read More

How to set the minimum width of an element with JavaScript?

Rishi Raj
Updated on 23-Jun-2020 13:25:42

1K+ Views

Use the minWidth property in JavaScript to set the minimum width. You can try to run the following code to set the minimum width of an element with JavaScript −ExampleLive Demo                    #box {             width: 50%;             background-color: gray;          }                     Click below to set Minimum width.       Min Width                This is a div. This ... Read More

How to set the minimum height of an element with JavaScript?

Kumar Varma
Updated on 23-Jun-2020 13:29:03

666 Views

Use the minHeight property in JavaScript to set the maximum height. You can try to run the following code to set the minimum height of an element with JavaScript −ExampleLive Demo                    #box {             width: 300px;             background-color: gray;             overflow: auto;          }                     Click below to set Minimum height.       Min Height         ... Read More

How to set the maximum width of an element with JavaScript?

Samual Sam
Updated on 23-Jun-2020 13:27:41

2K+ Views

Use the maxWidth property in JavaScript to set the maximum width.ExampleYou can try to run the following code to set the maximum width of an element with JavaScript −Live Demo           Click below to set Maximum width.       Max Width                This is a div. This is a div. This is a div.          This is a div. This is a div. This is a div.          This is a div. This is a div. This is a div.   ... Read More

How to set the right margin of an element with JavaScript?

Jai Janardhan
Updated on 23-Jun-2020 13:29:34

583 Views

Use the marginRight property in JavaScript, to set the right margin. You can try to run the following code to set the right margin of an element with JavaScript −ExampleLive Demo                    #myID {             border: 2px solid #000000;          }                     This is demo text.       Add right margin                function display() {             document.getElementById("myID").style.marginRight = "150px";          }          

How to set the top margin of an element with JavaScript?

Lakshmi Srinivas
Updated on 24-Jan-2020 06:37:27

1K+ Views

Use the marginTop property in JavaScript, to set the top margin. Can you try to run the following code to set the top margin of an element with JavaScript?ExampleLive Demo                    #myID {             border: 2px solid #000000;          }                     This is demo text.       Add top margin                function display() {             document.getElementById("myID").style.marginTop = "150px";          }          

Advertisements