14CSS basics

CSS Borders

Easy20MIN

CSS borders refer to adding border lines to HTML elements. Borders are usually used in website design to highlight certain parts or provide visual separation between different elements. Using CSS, you can define the color, style, thickness, and rounding of the border.

Below are examples of using CSS border styles:

Determining the color of the border

You can specify the border color in CSS using the border-color property. For example, if you want to set the border color to red, you can write the following rule:

CSS
1border-color: red;
1 / 5
Hakatemia Pro

Learn to hack — start here

Hundreds of interactive courses, virtual labs and CTF challenges in your browser. Start a free trial — no card required.