H5页面背景图片布局,盒子高度如何计算,能做到高度响应式展示?-灵析社区

我是张工你呢

.bg_01 { background: url("../images/bg_01.jpg") no-repeat center / cover; } .bg_02 { background: url("../images/bg_02.jpg") no-repeat center / cover; } .bg_02 { background: url("../images/bg_03.jpg") no-repeat center / cover; } .bg_01 { height: 200px; } .bg_02 { height: 300px; } .bg_03 { height: 360px; } H5页面背景图片布局,盒子高度如何计算,能做到高度响应式展示, 设计图宽度是375px

阅读量:302

点赞量:6

问AI
栀子花爷爷
为啥一定要用背景图?用图片不行吗? .wrapper .bg{ width: 100%; height: auto; }