html background属性让背景充满整个页面

在<body>标签里添加文件路径,语法如下

<body background="文件路径">

这时,页面虽然充满了背景,但可以看出背景图片被填充了多次。

html background属性让背景充满整个页面
html background属性让背景充满整个页面

在<body>里添加样式,代码如下:

style=" background-repeat:no-repeat ;

background-size:100% 100%; 

background-attachment: fixed;" 

你看,背景就充满页面了。

html background属性让背景充满整个页面

<body background="5.jpg"

style=" background-repeat:no-repeat ;

background-size:100% 100%; 

background-attachment:fixed;" >

posted @ 2022-07-21 23:39  mingruqi  阅读(1716)  评论(0)    收藏  举报