div的图片填充样式种类及设置

1.    none      <div style="background: url(2.jpg)  50% 50%/ auto auto no-repeat ;  1000px; height: 800px; border:1px solid blue;"/>
2.    tile 填充  <div style="background: url(3.jpg)    ;  1000px; height: 800px; border:1px solid blue;" />
3.    fill    <div style="background: url(3.jpg)   0% 0%/ 100% 100% no-repeat ;  1000px; height: 800px; border:1px solid blue;" />
4.uniform   判断宽高比例,图片宽高比>div宽高比,width 100% 否则 height100% 图片居中(auto 100%换位置)
                <div style="background: url(3.jpg)   50% 50%/ auto 100% no-repeat ;  1000px; height: 300px; border:1px solid blue;" />
                <div style="background: url(3.jpg)   50% 50%/  100% auto no-repeat ;  1000px; height: 300px; border:1px solid blue;" />
5.uniformToFill 跟uniform一样,不过(auto 100%换位置)
6.LeftTop    <div style="background: url(3.jpg)   0% 0%/ auto auto  no-repeat ;  1000px; height: 300px; border:1px solid blue;" />
原文地址:https://www.cnblogs.com/congqiandehoulai/p/12721346.html