需要准备的材料分别有:电脑、浏览器、html编辑器。
1、首先,打开html编辑器,新建html文件,例如:index.html。
2、在index.html中的<style>标签中,输入css代码:body {background: url(image.jpg) no-repeat;background-size: 100%}。
3、浏览器运行index.html页面,此时成功设定背景图片等比例放缩到网页宽度。
时间:2024-10-14 16:51:12
需要准备的材料分别有:电脑、浏览器、html编辑器。
1、首先,打开html编辑器,新建html文件,例如:index.html。
2、在index.html中的<style>标签中,输入css代码:body {background: url(image.jpg) no-repeat;background-size: 100%}。
3、浏览器运行index.html页面,此时成功设定背景图片等比例放缩到网页宽度。