css实现背景图片充满整个屏幕

责编:menVScode 2018-10-24 10:35 阅读(61)

css代码

html{
  height: 100%;
}
body{
  width: 100%;
  height: 100%;
  background: url("https://f.51fanbei.com/h5/app/activity/2018/07/buy_bg.png") center center no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

没错就这么几行代码~~~

标签: css
前端交流群: MVC前端网(menvscode.com)-qq交流群:551903636

邮箱快速注册

忘记密码