html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

lxf2023-03-09 08:48:01

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html怎么设置背景图片全屏平铺?

1、新建一个html文档

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

2、设置一下HTML的框架,然后把图片设置在同一个文件夹里面。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

3、加入<style type="text/css"></style>,这样可以有样式设置。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

4、因为背景设置在主体,所以还要定义为body{}。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

5、background-image:url(图片),这个是添加图片的意思。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

6、然后我们需要加入background-repeat:repeat-x;这个时候就会横向平铺。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

7、background-repeat:no-repeat;这样就可以不重复平铺。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

8、background-repeat:repeat-y;这个指令是纵向平铺。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

9、background-repeat:repeat;这样则是全屏平铺。

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

html设置背景图片平铺整个页面(html设置背景图片平铺整个页面怎么设置)

推荐教程: 《HTML教程》

以上就是html怎么设置背景图片全屏平铺?的详细内容,更多请关注AdminJS其它相关文章!