3 ms·
Aren't you describing https://developer.mozilla.org/en-US/docs/Web/CSS/outline https://developer.mozilla.org/en-US/docs/Web/CSS/outline? > Outline is a line ou
by Spivak 2y ago
Aren't you describing https://developer.mozilla.org/en-US/docs/Web/CSS/outline https://developer.mozilla.org/en-US/docs/Web/CSS/outline?
> Outline is a line outside of the element's border. Unlike other areas of the box, outlines don't take up space, so they don't affect the layout of the document in any way.
If you s/border/outline in the dev console on the image you get what you want.
- benatkin 2y agoOutline is used for :focus and :focus-visible, so box-shadow is nice to have for hover so you don't have to repurpose the outline for it.
- the_other 2y agoit seems to me that :hover and :focus are doing the same job in this case - indicating the target of the next action. I don’t see this as “repurposing”.
- Maken 2y agoIs there any directive against defining an outline for :hover?
- benatkin 2y agoNo, but when tabbing it's often more usable to have the outline look the same across different types of elements, and having a separate focus style from hover style makes it easier.