3 回答

WingMeng
TA贡献32条经验 获得超13个赞
补充一种方法:
<div class="box"> </div>
然后 CSS 部分:
.box { line-height: 1; font-size: 10em; /* 图片高度 */ border: 1px solid #ccc; background: url(xxx.jpg) center no-repeat; /* 图片 */ }

一诺yinol
TA贡献27条经验 获得超4个赞
直接同css写就行了,
width: 100%;
padding-top: 14%; /* 宽除以高的比例 */
height: 0;
position: relative;
background: url(img/**.jpg) no-repeat center center;
background-size: 100%;
添加回答
举报
0/150
提交
取消