Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set border radius of some corner only with CSS

Tags:

html

css

Enter image description here

As shown above, can I give a radius to the top parts only and not to bottom or sometimes to bottom not to top?

And is there any idea to give border radius to one corner only?

like image 981
luxi Avatar asked Oct 31 '25 07:10

luxi


2 Answers

Like border-radius:top-left top-right bottom-right bottom-left,

div{
    width: 100px;
    height: 30px; 
    background: black;
    border-radius: 8px 8px 0 0
}

DEMO

like image 52
Sowmya Avatar answered Nov 01 '25 21:11

Sowmya


Either use border-radius, such as:

border-radius: 5px 5px 5px 5px;

Or, for the top left border, you can be more specific with:

border-top-left-radius: 5px;
like image 38
hrr Avatar answered Nov 01 '25 22:11

hrr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!