我的问题是这样的:我为我的网页使用三个背景图像,其中两个我能够使用'background-position'属性正确定位,但第三个图像(lady.png )不会在浏览器窗口拉伸得更宽时停留在页面上我想要的位置。看起来她正在相对于浏览器的边缘定位。我试图使用'background-attachment:fixed'来将照片保存在一个地方,但这不起作用。CSS背景图片不会停留
我想要的是主要的顶部和底部图形对齐'顶部中心',并使女性的图像从左侧约200px,从顶部向下约300px。我已经尝试过“背景位置:200px300px”,但她仍然随着框架移动。任何援助将不胜感激。
下面是代码以现在这个页面:http://dev.salonbuilder.com/website/150099/services.asp
<td width="100%" style="background-image:url(<%=ImagePath%>lady.png),url(<%=ImagePath%>new-bg-top.jpg),url(<%=ImagePath%>new-bg-line.jpg);background-repeat:no-repeat,no-repeat,repeat-y;background-position:80px 150px, top center,top center; background-attachment: fixed, relative, relative;">
谢谢!
可以格式化多一点你的代码 – Asenar 2014-10-07 21:40:02
我不明白你的意思...我如何更加格式化代码? – Trinity 2014-10-07 21:46:27
您需要将您的代码缩进4个空格才能被格式化,并且您在td标记的开头缺少“<” – 2014-10-07 21:52:07