0
点赞
收藏
分享

微信扫一扫

【前端】让背景图片自适用

ITWYY 2022-03-11 阅读 70
javascript
.main {
  background: url(../assets/main.png) no-repeat;

  /**添加以下css */
  height: 100%; //大小设置为100%
  width: 100%; //大小设置为100%
  position: fixed;
  background-size: 100% 100%;
}
举报

相关推荐

0 条评论