Create beautiful boxes using the outline CSS property

Javascript Jeep🚙💨
Level Up Coding
Published in
3 min readJul 22, 2019

--

outline is a line outside the border of a container. Let’s create a simple rectangle and apply an outline and see how cool 😎 it is.

The syntx for ourline is outline: size type color;

The above code will create a beautiful frame 🖼 .

The available values are

outline: autoPermits the user agent to render a custom outline style.

outline: dottedThe outline is a series of dots instead of a solid line.

outline: doubleThe outline is two single lines. The outline-width is the sum of the two lines and the space between them.

We can also set the offset of the outline using outline-offset property.

outline: dashedThe outline is a series of short line segments.

outline: grooveThe outline looks as though it were carved into the page.

outline: ridgeThe opposite of groove. The outline looks as though it were extruded from the page.

Difference between groove and ridge.

outline: insetThe outline makes the box look as though it were embedded in the page.

outline: outset → The opposite of inset. The outline makes the box look as though it were coming out of the page.

You can set the outline as none, so that it doesn’t have an outline.

If you find this helpful surprise 🎁 me here.

Share if you feel happy 😃 😆 🙂 .

Follow Javascript Jeep🚙 if you feel worthy.

--

--