background-image 属性可以设置背景图像。
背景图像可以填充整个页面的,也可以填写一部分。
background-image 属性的使用很简单:background-image:url(图片地址)
填充整个页面示例
<!DOCTYPE html>
<
html
>
<
head
>
<
title
>背景图片</
title
>
<
style
type
=
"text/css"
>
body {
background-image: url("[https://www.liyongzhen.com/docs/images/crossline-dots.png](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fwww.liyongzhen.com%2Fdocs%2Fimages%2Fcrossline-dots.png)");
padding: 20px;}
</
style
>
</
head
>
<
body
>
<
h1
>软件开发,成就梦想</
h1
>
<
h2
>学编程,上利永贞网 [https://www.liyongzhen.com/](https://www.oschina.net/action/GoToLink?url=https%3A%2F%2Fwww.liyongzhen.com%2F)</
h2
>
</
body
>
</
html
>