我使用类似于从这里动态驱动器的一个布局: http://www.dynamicdrive.com/style/layouts/item/css-right-frame-layout/需要帮忙内DIV DIV伸展到内容宽度在Firefox
主要内容区(白色)已溢出设置为自动。我已经给这个主要内容区域内的innerTube一个边界。但是,如果此innerTube内的内容大于主要内容区域的宽度,则按预期显示一个水平滚动条,但在Firefox中,这些内容将“重叠”边框并离开屏幕(可通过水平滚动进行检索) 。换句话说,右边框保持原样,内容刚好超过它的操作,并在右栏后面消失。
在IE中,它的行为完全符合我的要求 - 内容将屏幕边框从屏幕上移开,只有在您滚动屏幕后才能看到。
我想最简单的事情就是在这里粘贴源代码。如果你把它复制到一个空白文件中,你会明白我的意思。我只用了一个非常长的单词来复制如果广泛的图像存在,会发生什么情况。
在此先感谢任何能帮助我的人。
<!--Force IE6 into quirks mode with this comment tag-->
<!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" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body{
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
}
#framecontent{
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 200px; /*Width of frame div*/
height: 100%;
overflow: hidden; /*Disable scrollbars. Set to "scroll" to enable*/
background: #cccccc;
color: white;
}
#maincontent{
position: fixed;
top: 0;
left: 0;
right: 200px; /*Set right value to WidthOfFrameDiv*/
bottom: 0;
overflow: auto;
background: #fff;
}
.innertube{
margin: 15px; /*Margins for inner DIV inside each DIV (to provide padding)*/
}
.innertubeWithBorder {
margin: 15px;
border: solid 1px #666666;
}
* html body{ /*IE6 hack*/
padding: 0 200px 0 0; /*Set value to (0 WidthOfFrameDiv 0 0)*/
}
* html #maincontent{ /*IE6 hack*/
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="framecontent">
<div class="innertube">
<h1>CSS Right Frame Layout</h1>
<h3>Sample text here</h3>
</div>
</div>
<div id="maincontent">
<div class="innertubeWithBorder">
<h1>Dynamic Drive CSS Library</h1>
<p>AReallyLongWordWhichIsSimilarToHavingAnImageWithWidthGreaterThanTheWidthOfThisDivToShowOverFlowProblemWithBorderSoIfYouResizeThisWindowNarrowerYouWillSeeWhatIMeanWorksFineInIEButNotFirefox</p>
<p>So I want that border over there ------> to dissappear behind the right hand column like it does in IE, and be visible once you use the scrollbar below and scroll to the right</p>
<p style="text-align: center">Credits: <a href="http://www.dynamicdrive.com/style/">Dynamic Drive CSS Library</a></p>
</div>
</div>
</body>
</html>
这里的问题是,你强迫IE怪癖模式。它可以在Chrome,Safari,Opera以及不是IE浏览器的Firefox中运行。摆脱怪癖模式,找到普遍适用的东西。 – cletus 2009-10-01 03:20:21
谢谢克利图斯。我只知道一小部分关于怪癖模式(主要是我在Quirksmode.org上读过的)。在任何情况下,如果摆脱怪癖模式意味着摆脱代码顶部的评论(“强制IE6进入怪癖模式”),那么我试图将其删除,问题仍然发生在Firefox中。 虽然谢谢。 – 2009-10-01 04:27:24