我不明白为什么会这样。
在所有非webkit浏览器上,我测试了下面的代码(IE8、FFx 3.x、Opera 10.x),在浏览器上没有滚动条
<pre>
我当然不想让它出现。
代码:
<!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" xml:lang="en-GB" lang="en-GB" dir="ltr">
<head>
<style type="text/css" media="screen,projection">
body {
color: black;
font-family: Verdana, sans-serif;
font-size: 90%;
}
#container {
font-size: 9pt;
}
#container-content {
color: black;
line-height: 1.5em;
}
pre {
background-color: #F9F9F9;
border: 1px dashed #2F6FAB;
color: black;
font-family: 'Courier New', monospace;
font-size: 1em;
line-height: 1.1em;
overflow: auto;
padding: 15px 20px;
width: 150px;
}
</style>
</head>
<body>
<div id="container">
<div id="container-content">
<pre>line 1
line 2
and this is a very long like it is, and this is a very long like it is
line 4</pre>
</div>
</div>
</body>
</html>
请注意,这是一个大型项目的代码片段。所有不相关的代码都被剥离。
正在删除
line-height