方法
关于网页背景固定代码的几种用法!
右上固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-position:100% 0%; background-repeat:no-repeat; background-attachment:fixed;} --> </STYLE>
右下固定専用
<!-- body { background-color: #FFFFFF; background-image: url(***.jpg); background-repeat: no-repeat; background-attachment: right bottom; } -->
左上固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-repeat:no-repeat; background-attachment:fixed;} --> </STYLE>
左下固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-position:0% 100%; background-repeat:no-repeat; background-attachment:fixed;} --> </STYLE>
左下固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-repeat:no-repeat; background-attachment:fixed; background-position:center ;} --> </STYLE>
右边固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-position:100% 0%; background-repeat:repeat-y; background-attachment:fixed;} --> </STYLE>
左边固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-repeat:repeat-y; background-attachment:fixed;} --> </STYLE>
上边固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:url("背景のURL"); background-repeat:repeat-x; background-attachment:fixed;} --> </STYLE>
下边固定専用
<STYLE TYPE="text/css"> <!-- BODY{ background-image:URL("背景のURL"); background-position:bottom; background-repeat:repeat-x; background-attachment:fixed;} --> </STYLE>
PS:页面放大缩小背景也会随之缩小