我在 <body>
中使用大背景标签,我想制作一个宽度为 960px 的容器 div。
我希望容器 div 位于从顶部向下 15px 的位置,我想我必须使用 position:absolute。
我的困境是;容器内的其余 div 必须包含相同的位置,否则我可以像普通的 960px 宽网站一样继续这个?
对不起,我的英语不好。
请帮我!
最佳答案
这应该为您的容器提供 960 像素的宽度,并以 10 像素的顶部(和底部!)边距将其居中。
#container {
width: 960 px; /* set width for container */
margin: 10px auto; /* 10px top and bottom, center screen */
}
关于css 困境(大背景),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4984309/