我需要在CSS的网页顶部中心有一个图片。现在,我只是在css中使用background-image:
,但这将它放在页面的中间。CSS把图片放在页面顶部
这里是我的代码:
body {
background-image: url("theimageurlgoeshere"); //The image is 842 x 508
background-attachment:fixed;
background-position: center top;
background-repeat: no-repeat;
}
此外,更改background-position:
似乎对网站的结果没有影响。任何帮助表示赞赏。
您定位的是哪种浏览器? – uhleeka 2010-05-20 23:47:36