如何将图像设置为网页背景
1、backgoround-image代码。我们用这个代码向一个网页中的body进行赋值就行了。
<html>
<head>
<style type="text/css">
body {background-image:url(/i/4.gif);}
</style>
</head>
<body></body>
</html>
2、在网页中的三个元素进行背景的图像指定。
<html>
<head>
<style type="text/css">
body {background-image:url(/i/4.gif);}
p.flower {background-image: url(/3.gif); padding: 20px;}
a.radio {background-image: url(/i/7.gif); padding: 20px;}
</style>
</head>
<body>
<p class="flower">落。<a href="*" class="radio">景的链接。</a>
</body>
</html>
3、background-repeat 代码的使用会让背景中的图像重复出现。
<style type="text/css">
body
{
background-image:
url(/i/eg_bg_03.gif);
background-repeat: repeat
}
</style>
4、我们重复背景图像的方法可以分为 水平重复或者垂直重复!
background-repeat: repeat-y
background-repeat: repeat-x
5、还有一种情况就是图像在网页当中只使用一次。
background-repeat: no-repeat
6、我们可以让图像在网页中的位置进行定位,这个位置是指定的。
background-position:center;
background-position:top;