1

I want rounded corner support in IE7 & IE8. I am using border-radius.htc file for that. It works perfectly with all corners having same border radius, but it does not work if I change the border radius of any of the corners. My code is :

<!DOCTYPE html>
<html>
<head>
<title>Border Radius for IE7+</title>
<style>
.borderRadius{
    background-color: #f0f0f0;
    width: 300px;
    height: 50px;
    margin: 20px auto;
    padding: 10px;
    border: 1px solid #d7d7d7;
    border-radius:10px;
    -webkit-border-radius:10px;
    -moz-border-radius:10px;
    behavior: url(border-radius.htc);
}
</style>
</head>
<body>
    <div class="borderRadius">
        Content in Div.
    </div>
</body>
</html>

This works fine. But it doesn't work if i change the style to

<style>
.borderRadius{
    background-color: #f0f0f0;
    width: 300px;
    height: 50px;
    margin: 20px auto;
    padding: 10px;
    border: 1px solid #d7d7d7;
    border-radius:10px 10px 0px 0px;
    -webkit-border-radius:10px 10px 0px 0px;
    -moz-border-radius:10px 10px 0px 0px;
    behavior: url(border-radius.htc);
}
</style>

It keeps all the rounded corners with same radius. Please help me to fix this problem.

4

2 に答える 2

0

これを試してください: http://jsfiddle.net/jplahn/62ESq/

動作していることがわかるように、半径を大きく誇張しましたが、試してみてください。

CSS:

.borderRadius{
    background-color: #f0f0f0;
    width: 300px;
    height: 50px;
    margin: 20px auto;
    padding: 10px;
    border: 1px solid #d7d7d7;

    -webkit-border-top-left-radius:100px;
    -webkit-border-top-right-radius:100px;
    -webkit-border-bottom-left-radius:25px;
    -webkit-border-bottom-right-radius:5px;
    -moz-border-radius:10px 10px 0px 0px;
     behavior: url(border-radius.htc);
}
于 2013-07-16T19:51:39.557 に答える