Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.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
3列html模板-内容溢出,但两者都很清楚,高度为100%_Html_Css - Fatal编程技术网

3列html模板-内容溢出,但两者都很清楚,高度为100%

3列html模板-内容溢出,但两者都很清楚,高度为100%,html,css,Html,Css,我在包装中有3个div: <div id="wrapper"> <div id="leftbar"> Lorem ipsum dolar sit amet </div><!--LEFTBAR--> <div id="middle"> Lorem ipsum dolar sit amet </div><!--middle--> <div id="rightbar"> Lorem ipsum dol

我在包装中有3个div:

<div id="wrapper">

<div id="leftbar">
Lorem ipsum dolar sit amet
</div><!--LEFTBAR-->

<div id="middle">
Lorem ipsum dolar sit amet
</div><!--middle-->

<div id="rightbar">
Lorem ipsum dolar sit amet
</div><!--RIGHTBAR-->

</div><!--wrapper-->

任何建议都将不胜感激

当您编辑您的问题时,我才知道它是如何溢出的,这是因为您使用的是
height:100%
,这样你的div就不会超过视口,所以使用
高度:auto代替,并使用
溢出:自动
用于
#textcontent
而不是
清除:两者都有正如穆萨告诉你的那样..(用firebug检查)

当你编辑你的问题时,我才知道它是如何溢出的,因为你使用的是
高度:100%
,这样你的div就不会超过视口,所以使用
高度:auto代替,并使用
溢出:自动
用于
#textcontent
而不是
清除:两者都有正如穆萨告诉你的那样..(用firebug检查)

如果你只需要文本,请尝试使用CSS3列。

如果你只需要文本,尝试使用CSS3列。

添加
溢出:自动
#textcontent
并删除
高度:100%
表单
#textcontent
#maincontent

添加
溢出:自动
#textcontent
并删除
高度:100%
表单
#textcontent
并删除
添加溢出属性并将高度更改为自动

#wrapper {
    width: 1000px;
    height: auto;
    margin:auto;
    padding: 30px;
    margin-top: 40px;
    background-color:#FFF;
    color:#000;
    border: 2px solid #828fc4;
    clear:both;
    overflow:hidden;
}
#middle {
    float:left;
    width: 580px;
    padding-left: 20px;
    padding-right: 20px;
    border-right: 1px dotted #2B308C;
    border-left: 1px dotted #2B308C;
}

添加溢出属性并将高度更改为“自动”

#wrapper {
    width: 1000px;
    height: auto;
    margin:auto;
    padding: 30px;
    margin-top: 40px;
    background-color:#FFF;
    color:#000;
    border: 2px solid #828fc4;
    clear:both;
    overflow:hidden;
}
#middle {
    float:left;
    width: 580px;
    padding-left: 20px;
    padding-right: 20px;
    border-right: 1px dotted #2B308C;
    border-left: 1px dotted #2B308C;
}

这是css文件,其中添加了一些小内容:

  • 为您的工具栏对齐文本
  • 包装中的宽度设置为1000px,因此所有px在棒材中平均分布

只要我的两分钱

这是css文件,还有一些小的添加:

  • 为您的工具栏对齐文本
  • 包装中的宽度设置为1000px,因此所有px在棒材中平均分布
只要我的两分钱

#wrapper {
width: 1000px;
height: auto;
margin:auto;
padding: 30px;
margin-top: 40px;
background-color:#FFF;
color:#000;
border: 2px solid #828fc4;
clear:both;
overflow:auto;
}
#leftbar {
float:left;
width: 250px;
padding: 5px;
text-align:center;
}

#middle {
float:left;
width: 400px;
padding-left: 20px;
padding-right: 20px;
border-right: 1px dotted #2B308C;
border-left: 1px dotted #2B308C;
text-align: center;
}

#rightbar {
float:right;
width: 250px;
padding: 5px;
text-align:center;
}