Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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
Css HTML宽度缩放不需要的水平滚动条_Css_Html_Percentage - Fatal编程技术网

Css HTML宽度缩放不需要的水平滚动条

Css HTML宽度缩放不需要的水平滚动条,css,html,percentage,Css,Html,Percentage,我在我的网页中使用了div的百分比,但是我遇到了一个问题,div扩展得太远,并且创建了一个不需要的水平滚动条,我希望div扩展到页面的100%,而不是超过它。如果有任何帮助,我将不胜感激。我已经查看了图像大小,并对它们进行了处理,现在已经尝试了每个图像的100%宽度,但没有效果 为了澄清,我想水平调整页面宽度以适应页面宽度,但不能创建水平滚动条。 下面是我的HTML和CSS: HTML: 加: 对于您想要的divcss,您可以使用CSS溢出 overflow-x:hidden; 这将隐藏水平滚

我在我的网页中使用了div的百分比,但是我遇到了一个问题,div扩展得太远,并且创建了一个不需要的水平滚动条,我希望div扩展到页面的100%,而不是超过它。如果有任何帮助,我将不胜感激。我已经查看了图像大小,并对它们进行了处理,现在已经尝试了每个图像的100%宽度,但没有效果

为了澄清,我想水平调整页面宽度以适应页面宽度,但不能创建水平滚动条。

下面是我的HTML和CSS:

HTML:

加:


对于您想要的divcss

,您可以使用CSS溢出

overflow-x:hidden;
这将隐藏水平滚动条溢出-x:隐藏;
您可以修复该错误。

是的,添加溢出:隐藏在css中 请不要使用内联css和外部css,这会使我们的观众更难阅读和理解。始终使用一个首选的外部css

#container {
    margin: 0px;
    background-color: #008852;
    font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
    color: #FFFFFF;
    text-align: left;
    max-width: 10%;
}

#main
{
height:100%;
weight:100&
}

html, body {
    overflow: auto;
    height: 100%;
}

#picturecontainer1{
    float: left;
}
#mainpage {
    border: thin solid #008852;
    width: 84%;
    float: left;
    background-color: #EDEFEE;
    height: auto;
    border-radius: 20px;
    height: 100%;
    position: fixed;
    color: #008852;
}
#menubar

ul
{
    list-style-type: none;
    margin: 0;
    padding: 0;
    float: left;
}
#menubar a:link, #menubar a:visited
{
    border-top-width: 1px;
    display: block;
    font-weight: bold;
    color: #000000;
    background-color: #EFF1EB;
    width: 180px;
    text-align: center;
    padding: 4px;
    text-decoration: none;
    text-transform: uppercase;
    border-style: solid;
    border-color: #638529;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px;
    position: fixed;
}
#menubar a:hover, #menubar a:active
{
    background-color: #7A991A;
}
#menubar {
    border-width: 1px;
    border-style: none;
    font-size: xx-small;
    width: 50%;
    margin-top: 11px;
    float: left;
    vertical-align: 0%;
}
#bannerdiv 
{
    
    margin-bottom:20px;
}

.newStyle1 {
    text-align: left;
}
footer {
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    background-color: #008852;
}
.auto-style1 {
    text-align: center;
    margin-left: 0px;
    margin-top: 11px;
    font-family: Georgia;
    margin-right: 0px;
}
s
#bannerdiv {
    text-align: center;
}
.auto-style4 {
    margin-left: 0px;
    text-align: left;
}
.auto-style5 {
    margin-top: 0px;
}
.auto-style8 {
    text-align: left;
    font-size: xx-small;
}
.auto-style6 {
    text-align: left;
    font-size: xx-small;
    font-weight: bold;
}
.auto-style10 {
    margin-left: 0px;
}
.auto-style12 {
    text-align: left;
    font-size: xx-small;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style11 {
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style9 {
    font-family: "Franklin Gothic Medium";
    position: fixed;
}
#container1 {
    font-family: Arial, Helvetica, sans-serif;
    margin-top: 20px;
    background-color: #008852;
    clear: right;
}

#table {
}
#mainpage a:link, #mainpage a:visited {
    font-family: Arial, Helvetica, sans-serif;
    font-size: small;
    font-weight: bold;
}
#picturecontainer2 {
    border-style: none;
    float: left;
}
#picturecontainer1 {
    border-style: none;
    width: 126px;
    border-right-width: thick;
    border-bottom-width: thick;
    border-left-width: thick;
}
.auto-style20 {
    text-align: center;
}
.auto-style21 {
    border-collapse: collapse;
    border-width: 0px;
    background-color: #EDEFEE;
}
.auto-style19 {
    text-align: left;
    font-size: small;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style17 {
    text-align: left;
    font-size: x-small;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style15 {
    text-align: left;
    font-size: x-small;
    font-weight: normal;
}
.auto-style18 {
    text-align: left;
    font-size: 12pt;
}
#mainpage a:link, #mainpage a:visited {
}
.auto-style23 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11pt;
    a text-decoration: none; 


}
.auto-style14 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9pt;
}
.auto-style15 {
    text-align: left;
    font-size: 9pt;
    font-weight: normal;
}
.auto-style17 {
    text-align: left;
    font-size: 9pt;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style18 {
    text-align: left;
    font-size: 12pt;
}
.auto-style19 {
    text-align: left;
    font-size: small;
    font-family: Arial, Helvetica, sans-serif;
}
#picturecontainer2 {
    border-style: none;
    float: left;
}
.auto-style20 {
    text-align: left;
    font-size: 9pt;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style21 {
    font-weight: normal;
}
#picturecontainer2 {
    border-style: none;
    float: left;
}
.auto-style14 {
    text-align: center;
}
.auto-style15 {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
}
#mainpage a:hover a: active {
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style25 {
    text-align: left;
    font-weight: normal;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style26 {
    text-align: left;
    font-size: x-small;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.auto-style27 {
    text-align: left;
    font-size: small;
    font-family: Arial, Helvetica, sans-serif;
}
overflow:hidden;
overflow-x:hidden;