2011-03-02 38 views
1

我有一个看起来像我的页面上的链接:Internet Explorer的多个类

<a href="www.wherever.com" class="tour-register id-tour-button"></a> 

和我的CSS写着:

.id-tour-button { display: inline-block; position:relative; z-index: 10; } 
a.tour-register { background: transparent url(../img/register.png) no-repeat; width: 133px; height: 23px; } 

这工作完全在Firefox,但在IE浏览器的链接消失,并且使用IETester进行的检查表明该元素根本不使用第二条线。我做了什么错?

+0

你测试了什么版本的IE? – roryf 2011-03-02 16:06:08

回答

2

多个类不在IE6中工作(它只保留第二个类,因此您获得的行为)。你准确使用哪个版本?

编辑:在查尔斯评论后,我错了,这个问题可能来自显示:内嵌块不很好理解(因此宽度&高度不适用,因为锚被视为内联处理。与display: block而不是?(它可能会打破你的设计,但至少你会看到发生了什么)

+2

我很肯定你在这里错了 - IE6没有如果你在* CSS选择器*中使用嵌套类,而不是在HTML类属性中使用多个类,那么它会将.tour-register.id-tour-button与.id-tour-button相同,但它不会将类=“tour-register id-tour-button”与class =“id-tour-button”相同。http://www.quirksmode .org/bugreports/archives/2004/12/IE_CSS_rendering_bug_with_multiple_classnames.html – 2011-03-02 15:58:25

+0

好点的查尔斯!我确实混淆了我的想法。 – Capsule 2011-03-02 16:16:00