Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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 收割台良好,100%宽度不';不在页脚上工作_Html_Css - Fatal编程技术网

Html 收割台良好,100%宽度不';不在页脚上工作

Html 收割台良好,100%宽度不';不在页脚上工作,html,css,Html,Css,在我目前正在处理的一个页面上,我遇到了一个错误。在某些计算机上,当您在桌面上查看页面时,页眉的宽度为100%,但页脚需要额外的宽度才能成为整页的宽度。此外,在其他一些计算机上,即使增加额外的宽度也不起作用。最后在右边有一点空间 任何帮助都将不胜感激 您的代码中有多个问题 这样做 body { margin: 0; } footer { margin-top: 50px; background-color: rgb(41, 41, 41); } .foot { positio

在我目前正在处理的一个页面上,我遇到了一个错误。在某些计算机上,当您在桌面上查看页面时,页眉的宽度为100%,但页脚需要额外的宽度才能成为整页的宽度。此外,在其他一些计算机上,即使增加额外的宽度也不起作用。最后在右边有一点空间

任何帮助都将不胜感激


您的代码中有多个问题

这样做

body {
  margin: 0;
}

footer {
  margin-top: 50px;
  background-color: rgb(41, 41, 41);
}

.foot {
  position: relative;
  height: 100px;
}

您的代码中有多个问题

这样做

body {
  margin: 0;
}

footer {
  margin-top: 50px;
  background-color: rgb(41, 41, 41);
}

.foot {
  position: relative;
  height: 100px;
}

正文上添加边距0

body {
    margin: 0;
}
.foot

 .foot {
    position: relative;
    background-color: rgb(41, 41, 41);
    margin-top: 50px;
    height: 100px;
    /* width: 100.8744%; */
    /* bottom: -8px; */
    /* left: -8px; */
}

正文上添加边距0

body {
    margin: 0;
}
.foot

 .foot {
    position: relative;
    background-color: rgb(41, 41, 41);
    margin-top: 50px;
    height: 100px;
    /* width: 100.8744%; */
    /* bottom: -8px; */
    /* left: -8px; */
}

不同的浏览器设置不同的默认CSS规则。尝试包括reset.css或normalise.css(谷歌搜索其中一个或“reset vs normalise”以查看差异)来删除这些默认值

用户代理样式表被您在自己的样式表中设置的任何内容覆盖。因此,在您的网页正文中设置了边距。因此,我们必须在css中显式添加以下代码

CSS

body{
margin:0
}

不同的浏览器设置不同的默认CSS规则。尝试包括reset.css或normalise.css(谷歌搜索其中一个或“reset vs normalise”以查看差异)来删除这些默认值

用户代理样式表被您在自己的样式表中设置的任何内容覆盖。因此,在您的网页正文中设置了边距。因此,我们必须在css中显式添加以下代码

CSS

body{
margin:0
}