CSS重复背景图像、只显示一次、固定位置显示等

CSS重复背景图像、只显示一次、固定位置显示等

<html>
<head>
<style type="text/css">
body
{
background-image:
url(/i/eg_bg_03.gif);
background-repeat: repeat
}
</style>
</head>
<body>
</body>
</html>

图片.png


如何在垂直方向重复背景图像
<html>
<head>
<style type="text/css">
body
{
background-image:
url(/i/eg_bg_03.gif);
background-repeat: repeat-y
}
</style>
</head>
<body>
</body>
</html>
图片.png
如何在水平方向重复背景图像
background-repeat: repeat-x
图片.png

如何仅显示一次背景图像
background-repeat: no-repeat
图片.png
如何放置背景图像
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
图片.png
如何使用%来定位背景图像
background-repeat: no-repeat;
background-attachment:fixed;
background-position: 30% 20%;
图片.png
如何使用像素来定位背景图像
background-repeat: no-repeat;
background-attachment:fixed;
background-position: 50px 100px;
图片.png
如何设置固定的背景图像
background-repeat:no-repeat;
background-attachment:fixed

图片.png
所有背景属性在一个声明之中
body
{
background: #ff0000 url(/i/eg_bg_03.gif) no-repeat fixed center;
}
图片.png

1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » CSS重复背景图像、只显示一次、固定位置显示等

作者: cjh


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!