I noticed that when I set outline-style: auto
in my CSS then the outline is always 2px wide, regardless of outline-width
, unless outline-width
is 0, then there is no outline.
Why do browsers ignore outline-width
in this case and how can I change the width? (I know I can use outline-style: solid
but it just doesn't give the same effect).
div {
background-color: #CCC;
width: 50px;
height: 50px;
margin: 10px;
outline-color: dodgerblue;
outline-style: auto;
display: inline-flex;
align-items: center;
justify-content: center;
}
<div style="outline-width: 0px">0px</div>
<div style="outline-width: 1px">1px</div>
<div style="outline-width: 10px">10px</div>
<div style="outline-width: 1em">1em</div>