0

我有一个 html 选项卡 CSS,它在 Chrome 和 Firefox 中正确显示,但在 Internet Explorer 中却没有。

这里的问题是与内容的联合点li是分开的,并且没有加入 Internet Explorer

CSS:

#header ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#header li {
    float: left;
    font: 10px arial,sans-serif;
    border: 1px solid #bbb;
    border-bottom-width: 0;
    margin: 0;
}

#header a {
    text-decoration: none;
    display: block;
    background: #eee;
    padding: 0.24em 1em;
    color: #00c;
    width: 8em;
    text-align: center;
}

#header a:hover {
    background: #ddf;
}

#header #selected {
    border-color: black;
}

#header #selected a {
    position: relative;
    top: 1px;
    background: white;
    color: black;
    font-weight: bold;
}

#content {
    border: 1px solid black;
    clear: both;
    padding: 0 1em;
}

html:

<div id="tabs">
    <div id="header">
        <ul>
            <li name_id="tab1" id="selected">
            <a name="" type="hyperlink" href="#">tab1</a>
            </li>

            <li name_id="tab2">
            <a name="" type="hyperlink" href="#">tab2</a>
            </li>
        </ul>
    </div>
    <div id="content">
        <div id="table-wrapper">
            <div id="table-scroll">
                <table width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <a href="#">Test Value 1</a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <a href="#">Test Value 2</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>​

jsfiddle.net 演示

4

2 回答 2

1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

DOCTYPE在您的 html 脚本中包含上述声明。

于 2012-09-03T19:35:03.260 回答
0

我有同样的问题,如果在阅读后通过将我的字体大小设置为小来解决。奇怪的!

于 2013-02-15T18:02:25.653 回答