Skip to main content

CSS Rounded Borders

The border-radius property adds rounded corners to an element. A bigger value makes the corners rounder.

Example

A 5px border-radius rounds the corners of the bordered paragraph.

Prompt
An HTML page that gives an element rounded corners. In an internal <style> block, give a paragraph a 2px solid red border and a border-radius of 5px. Add a paragraph to show the rounded corners.
Output: complete HTML page

All CSS Border Properties

A summary of the border properties:

  • border — all border properties in one declaration.
  • border-bottom, border-left, border-right, border-top — all properties for one side in one declaration.
  • border-color, border-style, border-width — color, style, and width of all four borders.
  • border-bottom-color, border-bottom-style, border-bottom-width — color, style, and width of the bottom border (and the same pattern for top, left, and right).
  • border-radius — sets the four corner radii for rounded corners.