<div style="background-image:url('19.jpg');height:40px;position:fixed;width:1274px">hello </div>我想修复这个div标签的位置,但不幸的是,我必须提供它的宽度我不确定,但我认为这是因为使用背景图像,如果我不提供宽度,背景图像不会流动到屏幕的右角。我想让图像从左到右排列,占据整个屏幕宽度?我如何做到这一点,任何帮助都是非常appreciated.Thanks的
发布于 2012-01-24 14:44:28
您可以尝试background-repeat:repeat-x而不是width。
发布于 2012-01-24 14:51:57
#header {
margin: 0 auto; //This is what you need, position: fixed is not needed.
background-image:url('19.jpg') repeat-x;
height: 40px;
}
<div id="header">
text
</div>https://stackoverflow.com/questions/8982951
复制相似问题