3

我的网站需要这个。背景图像应保持静态,但其上的网页必须在 asp.net 中向下滚动

<head runat="server"> <title></title>

   <style type="text/css"> 
    body { background-image: url('~/saibaba.jpg'); 
    background-repeat: no-repeat;
     background-position: center center; 
    background-attachment: fixed; } 
    #form2 { font-weight: 700; }
     </style>
     </head>

这是我的代码仍然无法正常工作

4

3 回答 3

1

body { background-attachment: fixed; }

于 2012-12-11T09:11:14.440 回答
0

有关放置背景图像的替代方法,请查看 Chris Coyiers 全屏图像

http://css-tricks.com/perfect-full-page-background-image/

它对我有用

于 2012-12-11T09:33:34.133 回答
0

试图将您的 CSS 代码与您的主页分开。将所有 CSS 代码放在可以在您的主页中调用的 .css 文件中。试试这个代码 -->>

background-image:url('path_of_file_be_sure');
background-attachment:fixed;
background-repeat:no-repeat;
background-position:center
于 2013-12-30T15:28:59.827 回答