白云苍狗い 2020-12-20 13:13 采纳率: 0%
浏览 78
已结题

给body这是固定定位后背景图片无法填满

.body{
    position:fixed;
    height:100%;
    weight:100%;
    background: url(../img/bg.jpg);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	background-color: blue;       
}

如上述代码  背景图片并没有把body 填充满为什么?

此时body宽高 和浏览器视口一样大,且跟随变化.

背景图片为什么只有一半大.

 

  • 写回答

2条回答 默认 最新

  • 无厘头编程 2020-12-20 14:19
    关注

    background: url(images/bg.jpg) no-repeat center center fixed;

    -webkit-background-size: cover;

    -moz-background-size: cover;

    -o-background-size: cover;

    background-size: cover;

    加多几个,你那是什么 browser?

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 4月24日

悬赏问题

  • ¥15 单纯型python实现编译报错
  • ¥15 c++2013读写oracle
  • ¥15 c++ gmssl sm2验签demo
  • ¥15 关于模的完全剩余系(关键词-数学方法)
  • ¥15 有没有人懂这个博图程序怎么写,还要跟SFB连接,真的不会,求帮助
  • ¥15 PVE8.2.7无法成功使用a5000的vGPU,什么原因
  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音