简体   繁体   中英

Why doesn't work border-radius in IE9 but in IE10 or Chrome?

I have a problem only with IE9, the reason... border-radius only in one div not working but in others div's works perfectly.

IE9 在此处输入图片说明

IE10, Chrome, FF 在此处输入图片说明

Html

<article id="main-login">
<div class="radius-10 shadow"></div>
<div id="area-login" class="radius-10 shadow">
    <h2>Iniciar sesión</h2>
    <p><input id="user-user" class="radius-10" type="text" placeholder="Usuario" required/></p>
    <p><input id="user-pass" class="radius-10" type="password" placeholder="Contraseña" required/></p>
    <p><input id="do-login" type="submit" value=""/></p>
    <small>Si aún no eres usuario</small>
    <medium>Registrate aquí</medium>
</div>
</article>

CSS

.radius-10 {
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}

.shadow {
    -webkit-box-shadow: 0px 1px 12px rgba(50, 50, 50, 0.75);
    -moz-box-shadow:    0px 1px 12px rgba(50, 50, 50, 0.75);
    box-shadow:         0px 1px 12px rgba(50, 50, 50, 0.75);
}
#main-login {
    margin-top: 25px;
    width: 100%;
}
#main-login div {
    display: inline-block;
    height: 170px;
    vertical-align: top;
} 
#main-login > div:first-child {
    background: url(../media/images/medicos.jpg) no-repeat;
    background-attachment:fixed;
    margin-right: 20px;
    overflow: hidden;
    width: 73%;
}
#area-login {
    background: rgb(255,255,255); /* Old browsers */
    /* IE9 SVG, needs conditional override of 'filter' to 'none' */
    background:     url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSI4MiUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZTVlY2VmIiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
    background: -moz-linear-gradient(top,  rgba(255,255,255,1) 82%, rgba(229,236,239,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(82%,rgba(255,255,255,1)), color-stop(100%,rgba(229,236,239,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(255,255,255,1) 82%,rgba(229,236,239,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(255,255,255,1) 82%,rgba(229,236,239,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(255,255,255,1) 82%,rgba(229,236,239,1) 100%); /* IE10+ */
    background: linear-gradient(to bottom,  rgba(255,255,255,1) 82%,rgba(229,236,239,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5ecef',GradientType=0 ); /* IE6-8 */
    width: 24%;
}

Update

Thanks for your time but I solve my problem.

Solution: Exists a problem using border-radius and filter in CSS, then just comment this line:

 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5ecef',GradientType=0 ); /* IE6-8 */

And works fine!!

Change the contents of the .radius-10 to this:

.radius-10 {
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}

And for IE9, add the line below, inside the <head> tag.

<meta http-equiv="X-UA-Compatible" content="IE=9" />

And finally, don't forget to add this:

<!DOCTYPE html>

Update

Change the display in #main-login div to block .

This problem is solved by declaring filter: none; for IE9 only. If you use conditional comments to help you get specific classes you may disable thi filter like so:

.ie9 .class-with-gradient {
    filter: none;
}

Or add another class for these elements (if there are more than 1) and disable it for them. Like so:

.gradient {
    filter: none;
}

Make sure that only IE9 gets this class. Otherwise - IE8 and IE7 will not get the filter either.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM