我的网站需要这个。 背景图片应保持静态,但其上的网页必须在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>
这是我的代码仍无效
答案 0 :(得分:1)
body { background-attachment: fixed; }
答案 1 :(得分:0)
答案 2 :(得分:0)
尝试将CSS代码与主页分开。将所有CSS代码放在.css文件中,该文件可以在主页面中调用。试试这段代码 - &gt;&gt;
background-image:url('path_of_file_be_sure');
background-attachment:fixed;
background-repeat:no-repeat;
background-position:center