- Home
- /
- CSS Borders
CSS Tutorial
Introduction
CSS Properties
CSS Designing
CSS Advance Topics
CSS FAQs
- Home
- /
- CSS Borders
CSS Borders
Borders in CSS let us visually define the edges of an HTML element—whether it’s a heading, paragraph, image, or container. With borders, you can make elements stand out, separate sections, or simply improve the visual structure of your page.
Border Style
The border-style
property lets you define how the border looks.
No Border
Hidden Border
Dotted Style
Dashed Style
Solid Style
Double Border
Groove Style
Ridge Style
Inset Border
Outset Border

Border Color
Use the border-color
property to change the color of a border. You can apply named colors, HEX, RGB, or HSL formats.
Purple Dotted Border
Orange Dashed Border
Green Solid Border
Blue HSL Double Border

Border Width
The border-width
property controls how thick or thin your border is.
5px Thick Border
Thin Border

Border Radius – Rounded Bord
The border-radius
property is used to create rounded corners.
You can also control each corner separately:
Rounded Border
Circle-like Border
Each corner has different curve

Borders in Tables – Border Collapse
When working with tables, borders of adjacent cells can either be separated or collapsed into one.
Item A
Item B
Item X
Item Y

Border Shorthand
You can use one line to set width, style, and color:
This is a dashed green border

Summary
Here’s what you can style with borders in CSS:.
Style: solid, dotted, dashed, double, etc.
Width: thin, medium, thick, or pixels
Color: named, HEX, RGB, or HSL
Radius: rounded corners
Collapse & spacing: in tables
Shorthand: everything in one line!