html中如何让背景图片全屏显示。

2025-06-28 20:35:52
推荐回答(5个)
回答1:

background:ur(../images/图片名.jpg) no-repeat;

剩下的就看个人需求了。

回答2:

直接在BODY里面添加背景图,背景图宽至少要1920px的!

回答3:

body{
heigiht:100%;
width:100%;
background
}

回答4:

如果你的页面很长,高度不确定
html,body{
width:100%;
height:auto;
overflow-x:hidden;
background:url(image.jpg);
}
如果你的页面只有一屏
html,body{
width:100%;
height:100%;
overflow:hidden;
background:url(image.jpg);
}
如果你不想背景重复
background:url(image.jpg) no-repeat;

回答5:

宽高百分百!