兼容性-inline-block

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            display: inline-block;
            background: red;
        }
    </style>
</head>
<body>
    <div>div1</div>
    <div>div2</div>
    <div>div3</div>
</body>
</html>

其餘瀏覽器正常顯示一行,IE6/7顯示效果以下(不認display:inline-block)html

能夠經過下面方法解決瀏覽器

*display: inline;
*zoom: 1;spa

div{
            width: 100px;
            height: 100px;
            display: inline-block;
            background: red;
            *display: inline;
            *zoom: 1;
}

 

 

問題2:當設置高度爲1px的時候,IE6顯示高度爲19px,能夠經過overflow:hidden解決code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{
            height: 1px;
            background: red;
        }
    </style>
</head>
<body>
    <div>div1</div>
</body>
</html>
相關文章
相關標籤/搜索