Borders in CSS
Borders in CSS Borders in CSS are used to create a visible outline around an element. We can apply borders to elements using border property or its individual longhand properties such as border-width, border- style and border-color. Here’s an overview of how you can use borders in CSS. 1. Border: This property allows you to set width, style and color of a border in one declaration. It follows the order as follows border-width, border-style and border-color. Ex: .element{ border: 1px solid blue; } 2. Border-width: This property sets the width of border. You can specify it in pixels, percentages. Ex: .element{ border-width: 2px; } 3. Border-style: This property sets the style of borders such as solid, dashed, dotted, double etc. Ex: .element{ border-style: dotted; } 4. Border-color: This property sets color of border. You can use color names, HEX codes, RGB, RGBA values. Ex: .element{ border-color: rgb(150, 50, 55); } 5. Border-radius: This property rounds the corn...