{"id":346652,"date":"2021-08-16T06:55:00","date_gmt":"2021-08-16T13:55:00","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=346652"},"modified":"2021-08-16T07:54:40","modified_gmt":"2021-08-16T14:54:40","slug":"outline-style","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/o\/outline-style\/","title":{"rendered":"outline-style"},"content":{"rendered":"\n

The outline-style<\/code> CSS property specifies the style of an element’s outline. What\u2019s an outline? An outline<\/dfn> is a line that is drawn around elements \u2014 outside the border edge \u2014 that is used for accessibility or decoration purposes when that element is in focus.<\/p>\n\n\n\n

button {\n  outline-style: dashed;\n}<\/code><\/pre>\n\n\n\n

outline-style<\/code> is a constituent property in the outline<\/code><\/a> shorthand and is defined in the CSS Basic User Interface Module Level 4<\/a> specification which is currently in Editor\u2019s Draft status.<\/p>\n\n\n\n\n\n\n

Usage<\/h3>\n\n\n

We usually set the outline of an element using the shorthand property:<\/p>\n\n\n\n

a:focus {\n  outline: 5px dashed black;\n}<\/code><\/pre>\n\n\n

Accessibility<\/h3>\n\n\n

By default, different user agents provide different outline styling on focused elements to help indicate non-mouse interactions for accessibility reasons, but that visual is generally beneficial to everyone. This styling is typically an outline around the element.<\/p>\n\n\n\n

\"\"
In Chrome, the outline style is a solid; in Firefox it is a lighter, partially dotted one.<\/figcaption><\/figure>\n\n\n\n

There are some reasons why you would want to change the default outline style:<\/p>\n\n\n\n