gpt4 book ai didi

css - HTML 网站太宽

转载 作者:太空宇宙 更新时间:2023-11-04 03:58:44 26 4
gpt4 key购买 nike

这是我正在修改的网站:sb460training.org

这是代码片段:

#apdiv1 {
position: absolute;
width: 2815px;
height: 276px;
z-index: 1;
top: 1px;
left: 0px;
background-color: #000;
}
#apdiv2 {
position: absolute;
width: 3150px;
height: 115px;
z-index: 2;
left: 0px;
top: 230px;
}
#apdiv3 {
position: absolute;
width: 221px;
height: 411px;
z-index: 3;
left: 0px;
top: 259px;
background-color: #FFF;
}
#apdiv4{
position: absolute;
width: 2853px;
height: 115px;
z-index: 4;
left: 219px;
top: 401px;
}

您知道宽度尺寸应该是多少,这样我才能摆脱显示在网页右侧的烦人的额外空间吗?谢谢

最佳答案

与其他答案一样,我同意您的 CSS 应将固定宽度更改为 100%。

但是,在您的 HTML 中,您有具有明确宽度的 img 元素来替代背景颜色。例如,在“apDiv2”DIV 元素中,您有一个包含白色的内联图像“SB460_Pic/Secondary title2.jpg”。此图像设置为 2128 像素宽,导致页面水平延伸。

我建议删除用于填充每个 DIV 右侧的图像,而是在 CSS 中设置背景颜色。

更新

快速而肮脏的例子:

http://pastebin.com/4PmZN1r4

关于css - HTML 网站太宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22411933/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com