css - outline: none VS outline: 0 -
i reading this question on disabling dashed borders around <a>
links. some answers used outline: none
, while some used outline: 0
is there difference between using outline: none
, outline: 0
?
according mdn:
the css
outline
property shorthand property setting 1 or more of individual outline propertiesoutline-style
,outline-width
,outline-color
in single declaration
so when set outline
none
or 0
, telling browser set 3 properties (outline-style
, outline-width
, outline-color
)
i used firefox developer tools find out difference:
as can see, both use default text color outline-color
, , both have outline-style
set none
. difference outline-width
:
- when
outline
0
,outline-width
0px
- when
outline
none
,outline-width
medium
that difference between two. can use either one, both display same way (since outline-style
none
, not matter how wide outline is).
Comments
Post a Comment