Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS限制了网站的宽度_Html_Css_User Interface_Layout - Fatal编程技术网

Html CSS限制了网站的宽度

Html CSS限制了网站的宽度,html,css,user-interface,layout,Html,Css,User Interface,Layout,我正在尝试创建一个干净的跨浏览器管理模板。我已经编码了一个侧栏导航,然后是一个主要内容区。但是,我遇到了一些问题,因为我在主区域(白色)中的内容似乎没有完全扩展 代码: 预览: 表格应占据白色内容区域的整个宽度。如何在不破坏布局的情况下修复此问题 这是可能导致问题的代码: #framecontent { position: absolute; width: 200px; height: 100%; overflow: hidden; background-

我正在尝试创建一个干净的跨浏览器管理模板。我已经编码了一个侧栏导航,然后是一个主要内容区。但是,我遇到了一些问题,因为我在主区域(白色)中的内容似乎没有完全扩展

代码:

预览:

表格应占据白色内容区域的整个宽度。如何在不破坏布局的情况下修复此问题

这是可能导致问题的代码:

#framecontent {
    position: absolute;
    width: 200px;
    height: 100%;
    overflow: hidden;
    background-color: #34495E;
}
#maincontent {
    position: fixed;
    left: 200px;
    overflow: auto;
}

我不使用绝对和固定定位,而是使用以下设置(应适用于ie8以上的所有浏览器):

html

<div class="wrapper">
    <div class="left">
        left stuff
    </div>
    <div class="right">
        right stuff
    </div>
</div>

您可以将
最小宽度
添加到
.wrapper
中,以便右列不会缩小到所需的大小以下


我能问一下这个的兼容性吗?是IE8+吗?谢谢你的帮助,顺便问一下,第一个应该在ie8 plus中工作,第二个应该是ie7 plus使用ie8+如果可以,你建议第一个解决方案更干净、更灵活,还是事实上你的第二个解决方案更好?我可能会选择第一个,因为它提供了表格的灵活性,另外,如果您需要添加一个正确的列,那么这会容易得多,而且您不需要担心清除浮动,因此标记/css更少,尽管已经说过,将溢出卷轴添加到第二个卷轴会更容易,因为第一个卷轴需要在单元格内添加另一个div,宽度和高度都为100%溢出卷轴,而第二个卷轴只需将溢出卷轴添加到.left和.rightdivs@Jimmy如果要使用原始代码,可以使用以下命令:
html, body {height: 100%; max-height: 100%; padding:0; margin:0;}
.wrapper {display:table; width:100%; height:100%;}
.wrapper > div {display:table-cell;}
.wrapper .left {width:200px; background-color:#34495E}