我需要为我的站点设置可调整大小的菜单和内容背景图片,因此当菜单条目过多或内容超出内容背景的边界时,它们都会被拉伸(stretch)。我需要垂直拉伸(stretch)。
请给我一个提示(一个实际的答案也可以)或一个很好的例子的链接吗?
非常感谢您!
最佳答案
您可能需要将一组元素组织成如下所示:
html:
<div id="element">
<div id="elementTop">
<div id="elementBottom">
</div>
</div>
</div>
CSS:
#element {
// tileable background image, repeat-y;
}
#elementTop {
// top, fixed portion of the background image, no-repeat
}
#elementBottom {
// bottom, fixed portion of the background image, no-repeat, set to:
background-position: 0 100%;
}
关于CSS调整菜单和内容背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3057139/