CSS固定网页背景图片代码

html+div+css 1655 0 2013-08-22

CSS固定网页背景图片代码
全体背景固定:
<STYLE type="text/css">
   BODY {background:url(/URL) fixed;}
</STYLE>

右上背景固定:
<STYLE type="text/css">
   BODY{
     background-image:url("背景URL");
     background-position:100% 0%;
     background-repeat :no-repeat;
     background-attachment:fixed;

  }
</STYLE>

右下背景固定:
<STYLE type="text/css">
   BODY{
     background-image:url("背景URL");
     background-position:100% 100%;
     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-position:0% 0%;
     background-repeat :no-repeat;
     background-attachment:fixed;
   }

</STYLE>
  
中间背景固定:
<STYLE type="text/css">

   BODY{
     background-image:url("背景URL");
     background-position:50% 50%;
     background-repeat :no-repeat;
     background-attachment:fixed;
   }

</STYLE>
  
横条背景的使用方法:
<style type="text/css">
 body {
   background-image: url("背景URL");
   background-attachment: fixed;
   background-repeat: repeat-y;
   background-position: left;
   background-color: #ffffff;
   }

</style>

上一篇:CSS实现横式压线菜单样式

下一篇:iframe自适应高度的多种方法方法小结

讨论数量:0

请先登录再发表讨论。 2024-04-23

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链