CSS Tutorials

Overview

A CSS outline is a line that is drawn around elements, outside the borders, prior to the margin, to give the element additional visibility to the user.

For example, the text element below has a red, dotted, 5px outline applied to it.

div {
    outline: red dotted 5px;
}
This element (text) has a 5px red outline on all four sides, outside of the black border.

Note

The outline is NOT calculated into the size of an element and may actually overlap the margin, or if there’s no margin, other elements next to it.

Outline Properties


CSS Notes:


We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.