How to implement “Rounded Corner on hover effect” in IE?

故事扮演 提交于 2019-12-04 15:45:09
thirtydot

As @Michael Rose says, IE8 and lower simply do not support CSS3 rounded corners.

There are a variety of workarounds to apply rounded corners in these versions of IE.

To my knowledge, the best of these workarounds is CSS3 PIE.

See another relevant answer I wrote:

Is .htc file a good practice in older versions of IE for rounded corners like CSS3 has?


Edit in response to your edited comment: I'm reasonably sure CSS3 PIE supports :hover properly.


Edit 2:

I just tried it, this CSS works:

a {
    color: black; background-color:#ddd;
    text-align: center;font-weight: bold;
    width:110px; height:25px;
    padding: 10px; text-decoration:none;
    behavior: url(PIE.htc);
}

.abc:hover {
    background-color: lightblue;
    -moz-border-radius: 15px; -webkit-border-radius: 15px; border-radius: 15px;
}

To make it work, I moved the behavior property to the a block instead of the .abc:hover block.

It's simply because rounded borders are only implemented in IE9 and not below.

You might check the compatibility with IE9, just add

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

to your page header and it's going to work, hopefully isA

Try this. It will work for IE9

<div class="rounded" style="background:#ddd"></div>

.rounded {
  height: 100px;
  width: 100px;
  margin-right: 20px;
  padding: 5px;
  border:2px solid #404040;
  border-radius: 5px;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!