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

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



   
      
   
   
      

Click below to add Outline Offset.

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. This is a div.

This is a div. This is a div. This is a div. This is a div. This is a div.



Updated on: 2026-03-11T23:14:18+05:30

248 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements