Web - Borders and Border Radius
📖 Read the lesson
Code Life
By Pierre Marsaa
Introduction to CSS Borders
Borders are lines that go around elements. They help define the boundaries of elements and can make your webpage look more structured.
In CSS, we can add borders to any HTML element. The basic border property has three parts:
1.
Width - how thick the border is
2.
Style - what the border looks like (solid, dashed, etc.)
3.
Color - what color the border is
↗️
Loading editor...
↶
▶️ Run
↷
In this example, we've added:
- A solid blue border around the h1 element
- A dashed red border around the paragraph
Verify