IE6显示错误的背景图片

发布于 2024-08-05 22:41:55 字数 764 浏览 1 评论 0原文

我使用 YUI 选项卡组件并自定义每个选项卡以显示唯一的图标,然后在选择选项卡时显示图标的变体。

正如我们所知,YUI 将“selected”类添加到所选选项卡中,并且我手动添加了“nav-xxx”,其中 xxx 是每个选项卡的选项卡名称。

我使用以下 css:

.nav-directory {
    background: url(/images/nav-browse.png) no-repeat scroll 0 0;
    height:34px;
    width:141px;
}

.nav-directory.selected {
    background: url(/images/nav-browse-selected.png) no-repeat scroll 0 0;
}

.nav-admin{
    background: url(/images/nav-admin.png) no-repeat scroll 0 0;
    height:34px;
    width:121px;
}

.nav-admin.selected {
    background: url(/images/nav-admin-selected.png) no-repeat scroll 0 0;
}

这在所有浏览器中都能完美运行,包括 IE8,但不适用于 IE6。当选择一个选项卡时,无论选择哪个选项卡,它都会显示相同的“选定”背景。

IE6 不正确支持组合类吗?

我知道如果不显示页面就很难解释,但它是在内联网系统上的。

谢谢

Im using the YUI tabs components and customised each tab to show a unique icon and then show a variation of the icon when the tab is selected.

As we know YUI adds 'selected' class to the selected tab and I manually added 'nav-xxx' where xxx is the tab name to each tab.

Im using the following css:

.nav-directory {
    background: url(/images/nav-browse.png) no-repeat scroll 0 0;
    height:34px;
    width:141px;
}

.nav-directory.selected {
    background: url(/images/nav-browse-selected.png) no-repeat scroll 0 0;
}

.nav-admin{
    background: url(/images/nav-admin.png) no-repeat scroll 0 0;
    height:34px;
    width:121px;
}

.nav-admin.selected {
    background: url(/images/nav-admin-selected.png) no-repeat scroll 0 0;
}

This works perfectly in all browsers including IE8 but not IE6. When a tab is selected it shows the same 'selected' background, nomatter which tab is selected.

Doesn't IE6 support combined classes correctly??

I know its hard to explain without showing the page but its on a intranet system.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身软味 2024-08-12 22:41:55

ie6 不理解链式类名,即“.nav-admin.selected”在 ie 中不起作用。

它只会查看最后一个类名并忽略其余部分。

ie6 doesn't understand chained class names, ie ".nav-admin.selected" won't work in ie.

It will just look at the last class name and ignore the rest.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文