0

IE 不显示圆角。如果我拿出来就可以了:hover

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Untitled Document</title>
        <style type="text/css">
            .tooltip {
                position:absolute;
                text-decoration: none;
                display:inline-block;
            }
            .tooltip span {
                margin-left:-999em;             
            }
            .tooltip:hover span {
                background-color: black;
                border-radius: 5px;
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
                color: #fff;
                display: inline-block;
                position: relative;
                left: 30px;
                padding: 10px;
                top:0px;
                z-index:1;
                behavior:url(PIE.htc);
                margin-left:0;
            }
        </style>
    </head>
    <body>
        <label>This is a label
            <a href="#" class="tooltip">
                <img src="img/help.jpg" style="border:1px solid black;width:15px;height:15px;position:absolute;left:5px;top:5px;"/>
                <span>This is a test</span>
            </a>
        </label>
    </body>
</html>
4

3 回答 3

3

您必须设置跨度以观察悬停元素(在您的情况下为“工具提示”元素)的行为变化。通过添加以下内容来设置跨度以观察“工具提示”行为变化:

.tooltip span {
    -pie-watch-ancestors: 1;
}

'1' 表示与圆角边框元素相关的祖先级别。

更多信息在这里: http ://css3pie.com/documentation/supported-css3-features/#pie-watch-ancestors

于 2013-06-25T14:48:02.060 回答
0

是的,您可以这样做,但您必须将行为声明放在不包含 :hover 选择器的样式规则中。您可以将其余样式保留在 :hover 块中。在悬停问题上 关注此IE

试着把你的行为:url(PIE.htc); 在 .tooltip{} 中。它对我有用。

于 2014-05-14T08:47:06.593 回答
0

尝试将行为应用于没有 :hover 伪类的元素:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Untitled Document</title>
        <style type="text/css">
            .tooltip {
                position:absolute;
                text-decoration: none;
                display:inline-block;
            }
            .tooltip span {
                margin-left:-999em;
                behavior:url(PIE.htc);          
            }
            .tooltip:hover span {
                background-color: black;
                border-radius: 5px;
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
                color: #fff;
                display: inline-block;
                position: relative;
                left: 30px;
                padding: 10px;
                top:0px;
                z-index:1;
                margin-left:0;
            }
        </style>
    </head>
    <body>
        <label>This is a label
            <a href="#" class="tooltip">
                <img src="img/help.jpg" style="border:1px solid black;width:15px;height:15px;position:absolute;left:5px;top:5px;"/>
                <span>This is a test</span>
            </a>
        </label>
    </body>
</html>

而且您应该隐藏具有负边距的元素:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Untitled Document</title>
        <style type="text/css">
            .tooltip {
                position:absolute;
                text-decoration: none;
                display:inline-block;
            }
            .tooltip span {
                left: 30px;
                top:0px;
                background-color: black;
                color: #fff;
                padding: 10px;
                display: none;
                border-radius: 5px;
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
                behavior:url(PIE.htc);     
                z-index:1;
                position: relative;
            }
            .tooltip:hover span {
                display: inline-block;
            }
        </style>
    </head>
    <body>
        <label>This is a label
            <a href="#" class="tooltip">
                <img src="img/help.jpg" style="border:1px solid black;width:15px;height:15px;position:absolute;left:5px;top:5px;"/>
                <span>This is a test</span>
            </a>
        </label>
    </body>
</html>
于 2012-12-21T13:41:27.637 回答