简体   繁体   中英

HTMLTabs CSS working in firefox and chrome but not in internet explorer

I have one html tab CSS where it shows properly in Chrome and Firefox but not in Internet Explorer.

Problem here is that joint point of li with content is separated and is not joining in 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 demo

<!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">

Include the above DOCTYPE declaration in your html script.

I had the same issue and solved if after reading this by setting my font size to small. Weird!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM