在HTML5中, web app 以及手机客户端中,设置页面图片等比例居中显示
接触前端时间不长,费了一些时间
img{display:block;max-width:100%;margin:auto;height: auto}
这里设置 max-width 为100%,如不然会出现问题,height 设置为 auto,可以达到等比例显示的效果.
在HTML5中, web app 以及手机客户端中,设置页面图片等比例居中显示
接触前端时间不长,费了一些时间
img{display:block;max-width:100%;margin:auto;height: auto}
这里设置 max-width 为100%,如不然会出现问题,height 设置为 auto,可以达到等比例显示的效果.