Custom outline style with CSS
Phong Duong
Posted on December 4, 2020
You can custom the outline of the component when you focus on it. CSS allows you to custom these properties:
outline-color
outline-style
outline-width
The order of these properties doesn't matter. You can use just one, two, or all three of them.
For example:
button {
background: tomato;
color: white;
border: none;
}
button:focus {
outline: blue dotted 5px;
}
When you click the button, you will see the blue dotted outline around the button.
The outline doesn't take up space. It won't affect the layout when it shows up.
π πͺ π
π©
Phong Duong
Posted on December 4, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
tailwindcss Learn how to create a responsive multi-column layout with Tailwind CSS
November 30, 2024
tailwindcss Integrating Tailwind CSS with Other Frontend Frameworks for Admin Panels
November 30, 2024