Nearby lessons

8 of 19

🟦 CSS Border Properties

📌 What are CSS Border Properties?

CSS Border Properties allow you to define the boundaries of HTML elements. You can control width, style, color, radius, and use shorthand to make your styling efficient and visually appealing.

📏 Border Width

The border-width property sets the thickness of the border. It can accept values like thin, medium, thick, or specific lengths in px, em, etc.

Example02
🎨Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

🎨 Border Style

The border-style property sets the type of border. Options include solid, dotted, dashed, double, groove, and ridge.

Example03
🎨Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

🌈 Border Color

The border-color property sets the color of the border. You can use named colors, HEX, RGB, or RGBA values.

Example04
🎨Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

🔵 Border Radius

The border-radius property allows you to round the corners of an element.

Example05
🎨Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

✍️ Border Shorthand

The border shorthand lets you set width, style, and color all in one declaration.

Example06
🎨Code Cell
Loading Editor...
✏️ You can edit this code — click Run to refresh the preview.
Output

🧠 Test Your Knowledge

5 Questions
Progress: 0 / 5