直到最近,我的网站都还不错,并且对齐得当。不久前,我集成了 thickbox onload。从那时起,该特定页面的对齐就变得一团糟。请帮帮我。
请通过link供大家引用
其他页面没问题,就是首页乱了。请指教。
最佳答案
你把 thickbox CSS 放在你的之后。
thcickbox css 中的第一行:
*{padding: 0; margin: 0;}
你的 #main
div 是如何居中的:
#main { background-color:; background-image: url('images/orange2.jpg')
margin-right: auto;
margin-left: auto;
}
body {background-color:;background-image: url('images/orange-20.jpg')}
*{border: 0;margin-top: 0px;margin-bottom: 0px;}
由于 thickbox CSS,margin: 0 auto
方法被取消。
2 种解决方案:
- 删除thickbox css的第一行
- 把你的 CSS 放在后面试试。
正如@livetolearn 所说,使用width
居中的方法更好。
另一方面,您的 CSS 是高度可优化的。 例如,
background-color:; background-image: url('images/orange2.jpg')
=
background:url('images/orange2.jpg')
关于javascript - 网站对齐问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4451161/