Skip to content Skip to sidebar Skip to footer

How To Set Border Radius Of Some Corner Only With Css

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?

Solution 1:

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

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

DEMO

Solution 2:

Either use border-radius, such as:

border-radius: 5px5px5px5px;

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

border-top-left-radius: 5px;

Solution 3:

Here's the CSS for the rounded corners only on a div with a class of box:

.box { border-radius: 5px 5px 0px 0px; }

You may also find this helpful: http://css3generator.com/

Edit:Apparently you don't need the webkit prefix anymore!

Post a Comment for "How To Set Border Radius Of Some Corner Only With Css"