border-radius: 25px;
background: #58257b;
color:white;
padding: 20px;
width: 200px;
height: 150px;
}
2. Round the corners of an outer border element
#rcorners2 {
border-radius: 25px;
border: 2px solid #58257b;
padding: 20px;
width: 200px;
height: 150px;
}
3. Bo round the corners of an element with the background as a defined image
#rcorners3 {
border-radius: 25px;
background: url(paper.gif);
background-position: left top;
background-repeat: repeat;
padding: 20px;
width: 200px;
height: 150px; }
Full code:
Round the corners of an element with the specified background color:
Rounded Corner in CSS
Bo round the corners of an outer border element:
Rounded Corner in CSS
Bo round the corners of an element with the background as a defined image
Rounded Corner in CSS
The border-radius attribute can have from one to four values. First you need to distinguish the corners in an element:
These four values will correspond to four corners: border-radius: angle-1 angle-2 angle-3 angle-4
For example:
#rcorners1 {
border-radius: 15px 50px 30px 5px;
background: #58257b;
padding: 20px;
width: 200px;
height: 150px;
}
These three values correspond to the following:
For example:
#rcorners2 {
border-radius: 15px 50px 30px;
background: #58257b;
padding: 20px;
width: 200px;
height: 150px;
}
These two values correspond to the following:
For example:
#rcorners3 {
border-radius: 15px 50px;
background: #58257b;
padding: 20px;
width: 200px;
height: 150px;
}
This value applies to all four corners, creating an image with equal angles
For example:
#rcorners4 {
border-radius: 15px;
background: #58257b;
padding: 20px;
width: 200px;
height: 150px;
}
Full code :
Border-radius: 15px 50px 30px 5px:
Border-radius: 15px 50px 30px:
Border-radius: 15px 50px:
Border-radius: 15px:
Previous post: CSS Specificity
Next article: Border Image - Create a picture border in CSS