本教程介绍:1.如何仅显示一次背景图像,2.如何放置背景图像,3.如何使用%来定位背景图像。
参考网页教学网关于CSS背景的理论知识:。
1、如何仅显示一次背景图像
本例演示如何仅显示一次背景图像。
<html>
<head>
<style type="text/css">
body
{
background-image: url(‘/i/eg_bg_03.gif’);
background-repeat: no-repeat
}
</style>
</head>
<body>
</body>
</html>
2、如何放置背景图像
本例演示如何在页面上放置背景图像。看到本信息说明该文是通过网页教学(phpstudy.net)整理发布的,请不要删掉!
<html>
<head>
<style type="text/css">
body
{
background-image:url(‘/i/eg_bg_03.gif’);
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}
</style>
</head>
<body>
<body>
<p><b>注释:</b>为了在 Mozilla 中实现此效果,background-attachment 属性必须设置为 "fixed"。</p>
</body>
</body>
</html>
3、如何使用%来定位背景图像
本例演示如何使用百分比来在页面上定位背景图像。
<html>
<head>
<style type="text/css">
body
{
background-image: url(‘/i/eg_bg_03.gif’);
background-repeat: no-repeat;
background-attachment:fixed;
background-position: 30% 20%;
}
</style>
</head>
<body>
<p><b>注释:</b>为了在 Mozilla 中实现此效果,background-attachment 属性必须设置为 "fixed"。</p>
</body>
</html>
—-想了解更多的linux相关异常处理怎么解决关注<计算机技术网(www.ctvol.com)!!>
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/csstutorial/63487.html