How do I make corners rounded only on the top part of the border in css?
HtmlCssHtml Problem Overview
In my site I need to make a div have rounded corners only on the top corners. But I don't know how to do this. Can someone help me?
Html Solutions
Solution 1 - Html
Brendan's answer is correct, but to get it to render in more browsers, you should use this:
-moz-border-radius: 0px;
-webkit-border-radius: 3px 3px 0px 0px;
border-radius: 3px 3px 0px 0px;
Solution 2 - Html
border-top-left-radius: 3px;
border-top-right-radius: 3px;
Solution 3 - Html
The other answers are correct but there is the shorthand solution:
border-radius: 3px 3px 0 0;
which will round only the top corners and leave the bottom ones alone. The order of the values is clockwise - top left, top right, bottom right, bottom left.
Here's an example: http://jsfiddle.net/9sXWf/