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

2025-05-17 10:01:26

1、打开Dreamweaver,然后选中html,出来了一个html标准文档。

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

2、在<body>标签里添加文件路径,语法如下<body background="文件路径">这时,页面虽然充满了背景,但可以看出背景图片被填充了多次。

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

3、在<body>里添加样式,代码如下:style=" background-repeat:no-repeat ;background-size:100% 100%;background-attachment: fixed;"你看,背景就充满页面了。

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

4、整个实现代艨位雅剖码如下:<body background="5.jpg"styl髫潋啜缅e=" background-repeat:no-repeat ;background-size:100% 100%;background-attachment:fixed;" >

5、我尝试通过外联式样式和嵌入式样式实现这个功能,但没有成功。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢