html设置背景图片平铺方法

 时间:2026-04-27 19:24:41

1、新建一个html文档。

html设置背景图片平铺方法

html设置背景图片平铺方法

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

html设置背景图片平铺方法

html设置背景图片平铺方法

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

html设置背景图片平铺方法

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

html设置背景图片平铺方法

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

html设置背景图片平铺方法

html设置背景图片平铺方法

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

html设置背景图片平铺方法

html设置背景图片平铺方法

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

html设置背景图片平铺方法

html设置背景图片平铺方法

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

html设置背景图片平铺方法

html设置背景图片平铺方法

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

html设置背景图片平铺方法

html设置背景图片平铺方法

  • 怎样让html中的文字垂直水平居中显示
  • html图片大小怎么设置
  • html如何文字居中与背景
  • html设置网页背景图片全屏
  • html鼠标悬停变色
  • 热门搜索
    右肾囊肿是怎么回事 九制陈皮的做法 日立中央空调怎么样 为什么生我 红枣粥的做法 微信怎么注销 苹果手机怎么下载软件 辞工书怎么写 怎么看电脑型号 苹果的做法大全