border-radius with Three Values
border-radius with three values in CSS allows customization of the curvature of the top-left, top-right, and bottom-left corners of an element while keeping the bottom-right corner square.
Example: In this example, we are giving three values to the border-radius property. The first value is for the top-left corner, The second value is for the top-right corner and bottom-left corner, and the third value is for the bottom-right corner.
HTML
<!DOCTYPE html> < html lang = "en" > < head > < meta charset = "UTF-8" > < meta name = "viewport" content=" width = device -width, initial-scale = 1 .0"> < link rel = "stylesheet" href = "index2.css" > < title >CSS border radius</ title > </ head > < body > < div class = "container flex-utility" > < div class = "gfg-heading" > w3wiki </ div > < p class = "text" > First value (top-left corner) </ p > < p class = "text" > Second value (top-right and bottom-left corners) </ p > < p class = "text" > Third value ( bottom-right corners) </ p > < div class = "flex-utility box-items" > < div class = "box box1 three-px-unit flex-utility" > Using px unit </ div > < div class = "box box2 three-p-unit flex-utility" > Using % unit </ div > < div class = "box box3 three-em-unit flex-utility" > Using em unit </ div > < div class = "box box4 three-rem-unit flex-utility" > Using rem unit </ div > </ div > </ div > </ body > </ html > |
CSS
/* Write CSS Here */ @import url ( 'https://fonts.googleapis.com/css2?family=Poppins&display=swap' ); .flex-utility { display : flex; align-items: center ; justify- content : center ; } .container { height : 100 vh; flex- direction : column; gap: 50px ; font-family : 'Poppins' , sans-serif ; } .box { height : 100px ; width : 200px ; font-size : 20px ; } .box-items { gap: 50px ; flex-wrap: wrap; } .gfg-heading { color : rgb ( 17 , 85 , 17 ); font-size : 50px ; } .three-px-unit { border-radius: 15px 10px 5px ; background-color : rgb ( 60 , 145 , 79 ); color : beige; border : 2px solid black ; } .three-em-unit { border-radius: 2em 4em 8em ; background-color : rgb ( 60 , 145 , 79 ); border : 2px solid black ; color : beige; } .three-rem-unit { border-radius: 3 rem 6 rem 9 rem; border : 10px ; background-color : rgb ( 60 , 145 , 79 ); border : 2px solid black ; color : beige; } .three-p-unit { border-radius: 25% 50% 38% ; background-color : rgb ( 60 , 145 , 79 ); border : 2px solid black ; color : beige; } .text { font-size : 25px ; } |
Output:
CSS Rounded Corners
CSS Rounded Corner facilitates the border-radius Property to create corners round for the element. The border-radius Property in CSS is used to define the radius and make corners round from the outer border edge of a specific element. This article will cover all the related aspects of the border-radius Property & understand them with the help of suitable examples.
Table of Content
- CSS border-radius Property
- border-radius with One Value
- border-radius with Two Values
- border-radius with Three Values
- border-radius Four Values
- Other CSS border Property
- border-top-left-radius
- border-top-right-radius
- border-bottom-right-radius
- border-bottom-left- radius