When working with CSS, it's possible to adjust the outline width using the code outline: 1px solid red
, and tweak its offset (similar to padding) with outline-offset: 5px
.
Unfortunately, this approach lacks the simplicity of the shorthand method used by padding
, such as border: 1px 2px 3px 4px
, and doesn't offer an outline-offset-left: 1px
option.
So, is there a way to customize different offsets on each side for a CSS outline? I want to avoid using padding
since it would alter the outlines as desired but add unnecessary space to elements where it's not needed - defeating the purpose of using outline
in the first place.