w1coding.comAll tutorials

CSS Outline

CSS lessons
  1. Environment Setup
  2. Introduction
  3. Tdisplay
  4. Basics
  5. Editors
  6. Syntax
  7. Colors
  8. Background
  9. Borders
  10. Margins
  11. Padding
  12. Width And Height
  13. Outline
  14. Texts
  15. Fonts
  16. Icons
  17. Links
  18. Lists
  19. Display
  20. Tables
  21. Max And With
  22. Positon
  23. Z Index
  24. Dropdown
  25. Overflow
  26. Float
  27. Navigation
  28. Image Sprites

CSS Outline

Introduction to CSS Outline

The CSS outline is a line drawn around elements outside the border, making it a useful tool for emphasizing content. Unlike borders, outlines do not take up space in the box model.

CSS Outline Properties

  • outline-style: Specifies the style of the outline, such as solid, dashed, or dotted.
  • outline-color: Sets the color of the outline.
  • outline-width: Defines the thickness of the outline.
  • outline-offset: Sets the space between the border and the outline.

Example


button {
    outline: 2px solid blue;
    outline-offset: 5px;
}
        

Browser Support

Most modern browsers support outline properties.