CSS标签样式问题 [英] CSS tab styling problem

查看:118
本文介绍了CSS标签样式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net页面中添加了3个选项卡,当我在IE7中浏览该页面时,这些选项卡不显示,但与IE8和FF完美配合.
我想知道问题出在哪里.

有人可以解释这种奇怪的行为吗?

我的CSS代码:

I added 3 tabs in my asp.net page and when I browse the page in IE7 the tabs don''t display, but it works perfectly well with IE8 and FF.
I want to know what the problem is.

Can anybody explain this strange behavior?

My CSS code:

/* root element for tabs  */
ul.tabs {
    list-style:none;
    margin:0 !important;
    padding:0;
    /*border-bottom:1px solid #666; */
    height:38px;
}

/* single tab */
ul.tabs li {
    float:right;
    text-indent:0;
    padding:0;
    margin:0 !important;
    list-style-image:none !important;
    border-right:1px solid #fff; border-left:1px solid #fff;
}

/* link inside the tab. uses a background image */
ul.tabs a {
    background: url(tab4-bg.jpg) repeat-x -420px 0;
    font-size:11px;
    display:block;
    height: 38px;
    line-height:30px;
    width:auto;
    text-align:center;
    text-decoration:none;
    color:#333;
    padding:0 10px;
    margin:0px;
    position:relative;
    top:1px;
}

ul.tabs a:active {
    outline:none;
}

/* when mouse enters the tab move the background image */
ul.tabs a:hover {
    background-position: -420px -40px;
    color:#000;
    background:url(tab3-bg.jpg) repeat-x;
}

/* active tab uses a class name "current". its highlight is also done by moving the background image. */
ul.tabs a.current, ul.tabs a.current:hover, ul.tabs li.current a {
    background-position: -420px -62px;
    cursor:default !important;
    color:#000 !important;
    background:url(tab3-bg.jpg) repeat-x;
}

/* Different widths for tabs: use a class name: w1, w2, w3 or w2 */
/* width 1 */
ul.tabs a.s           { background-position: -553px 0; width:81px; }
ul.tabs a.s:hover     { background-position: -553px -31px; }
ul.tabs a.s.current   { background-position: -553px -62px; }

/* width 2 */
ul.tabs a.l           { background-position: -248px -0px; width:174px; }
ul.tabs a.l:hover     { background-position: -248px -31px; }
ul.tabs a.l.current   { background-position: -248px -62px; }

/* width 3 */
ul.tabs a.xl          { background-position: 0 -0px; width:248px; }
ul.tabs a.xl:hover    { background-position: 0 -31px; }
ul.tabs a.xl.current  { background-position: 0 -62px; }



在此先感谢!



Thanks in advance!

推荐答案



此问题可能与以下IE7错误有关: http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/WhichRuleMustPrevail .html [ ^ ]

该错误的描述如下: IE7错误(goto bug Nr.100) [
Hi,

this problem may have to do with this IE7 bug: http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/WhichRuleMustPrevail.html[^]

The bug is described here: IE7 Bugs (goto bug Nr. 100)[^]

Regards,
Manfred


这篇关于CSS标签样式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆