Skip to content

Instantly share code, notes, and snippets.

@codewithmanas
Last active February 20, 2023 11:36
Show Gist options
  • Save codewithmanas/6d959e6bd3d313939cdbfc618f7ceb90 to your computer and use it in GitHub Desktop.
Save codewithmanas/6d959e6bd3d313939cdbfc618f7ceb90 to your computer and use it in GitHub Desktop.
CSS outline width not working

CSS outline-width not working

Just add outline-style: solid; to your css and it will work.

  outline-width: 1px;
  outline-style: solid;
Explanation:

The outline-width setting doesn't work without specifying outline-style. if no outline style is set, the browser will render the outline in its default style (which could be anything, such as a dotted rectangle in IE, a shaded rectangle in Chrome, or even nothing).

Only if you specify outline-style the outline-width will take effect.

If you want to remove all the outline properties(that is width, style, color), just add outline: none; to your css.

Please check and let me know your feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment