最近在我的本機win 7 + firefox 26.0 下遇到個很頭大的bug,帶滾動條的div容器裏面的文字竟然溢出到容器之外了,見圖:
測試頁地址: http://jsgame.net/_demos/test-stylebug.html
在我的環境下,百分百能重現,但到兩臺別人機器上就無法重現。
我的系統環境和瀏覽器並沒有什麼特殊之處,百思不得其解,真是人品不行啊。
這是個簡單的HTML文檔,4條簡單的CSS規則,十來行簡單的HTML,不含JS,全部源碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML5</title>
<style type="text/css">
ul{
list-style-type: none;
padding:0;
}
li {
white-space: nowrap;
}
.box {
overflow:auto;
width: 200px;
height: 140px;
border: solid 1px #66f;
}
.icon {
display: inline-block;
background-image: url("tree_file.gif");
background-repeat: no-repeat;
width: 16px;
height: 18px;
vertical-align: middle;
}
</style>
</head>
<body>
<div class="box">
<div style="width:10px;height:20px;"></div>
<ul>
<li>
<span class="icon"></span>
<span>Hello world Hello world Hello world Hello world</span>
</li>
<li>
<span class="icon"></span>
<span>Hello world Hello world Hello world Hello world</span>
</li>
</ul>
<div style="width:10px;height:100px;"></div>
</div>
</body>
</html>