Rounded Borders

CSS Rounded Borders

 

CSS Rounded Borders

The border-radius property is used to add rounded borders to an element:

Normal border

Round border

Rounder border

Roundest border

Example

p {
  border: 2px solid red;
  border-radius: 5px;
}

More Examples


This example demonstrates a shorthand property for setting all of the properties for the top border in one declaration.


This example demonstrates how to set the style of the bottom border.


This example demonstrates how to set the width of the left border.


This example demonstrates how to set the color of the four borders. It can have from one to four colors.


This example demonstrates how to set the color of the right border.



Test Yourself With Exercises

Exercise:

Use the border shorthand property to set a "4px", "dotted", "red" border for the

elements.





 


All CSS Border Properties

Property Description
  Sets all the border properties in one declaration
  Sets all the bottom border properties in one declaration
  Sets the color of the bottom border
  Sets the style of the bottom border
  Sets the width of the bottom border
  Sets the color of the four borders
  Sets all the left border properties in one declaration
  Sets the color of the left border
  Sets the style of the left border
  Sets the width of the left border
  Sets all the four border-*-radius properties for rounded corners
  Sets all the right border properties in one declaration
  Sets the color of the right border
  Sets the style of the right border
  Sets the width of the right border
  Sets the style of the four borders
  Sets all the top border properties in one declaration
  Sets the color of the top border
  Sets the style of the top border
  Sets the width of the top border
  Sets the width of the four borders

 

 
Rounded Borders

Login
ADS CODE