🔍
👶 Kids📝 Blog About Contact 🚀 Get Started Free

CSS Borders

The CSS border properties allow you to specify the style, width, and color of an element's border.

The CSS border property lets you draw a line around any element. You can control the style, width, color, and even rounded corners.

Try It — All Border Types

Preview

Border Shorthand

Instead of writing three separate properties, use the shorthand:

/* border: width style color; */
border: 2px solid red;

Border Properties Reference

PropertyValuesExample
border-stylesolid, dashed, dotted, double, noneborder-style: dashed
border-widthpx, em, thin, medium, thickborder-width: 3px
border-colorany colorborder-color: red
border-radiuspx or %border-radius: 8px

Tip: border-radius: 50% on an element with equal width and height makes a perfect circle!