CSS rounded corners
In this article we will see how we can get rounded corner effect using border radius without going through the laborious process of creating images and fitting them in every item corner to create the desired effect.
We will instead use something that designers and developers have already begun to adopt with great joy in CSS.
CSS rounded corners - how to create - example
With CSS, you can give each element "rounded corners" using proprietary radius borders.
Here are three examples:
1. rounded corners for an item with a specified background color,
2. rounded corners for an element with a border,
3. rounded corners for an element with a background image.
Here is the code:
.corner-radius1
{
border-radius:12px;
padding:10px;
width:250px;
height:160px;
background-color: #FF9;
float: left;
}
.corner-radius2
{
border-radius:12px;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}
.corner-radius3
{
border-radius:12px;
padding:10px;
width:250px;
height:160px;
background-image: url(https://www.agernic.com/uploads/paper.gif);
float: left;
margin-left: 18px;
}
HTML cod above will display this result -
CSS border-radius - Specify each corner - How to create
If you specify a single border property radius value, this radius will be applied to all four corners.
However, you can specify each corner separately if you want. Here are the rules:
Four values: the first value is valid for the top left, the second value is applied from the top right, the third value is applied to the bottom right, and the fourth value is applied in the lower-left corner
Three values: the first value is valid for the top left, the second value is for the top-right and the lower-left, and the third value is applied to the bottom-right
There are two values: the first value is applied to the top left and right-hand corner, and the second value is applied from the top right and the lower-left corner
A single value: all four corners are rounded evenly
Here are three examples:
1. Four values - border-radius:15px 50px 30px 5px:
2. three values - border-radius:15px 50px 30px:
3. There are two values - border-radius:15px 50px:
border-radius: 15px 50px 30px 5px;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}
.corner-radius5 {
border-radius: 15px 50px 30px;
background:#73AD21;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}
.corner-radius6 {
border-radius:15px 50px;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}
css border radius, css border radius without images
CSS rounded corners - css tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.