background-image:url(data:image/gif;base64,XXXX) base64方式将本地图片添加到文档中

时间:2021-08-15 05:52:41

background-image:url(data:image/gif;base64,R0lGODlhCwAMAMZjAElxvlNvtVRxtkp1v0p9wVh7vkqBwl58vml6vml7vm19qHJ+qXSBwXiAwHWBv2eFxk+QzHCJx36HwlCUzoKJw3eNyluY1XuQy1Od1lSh2FWi22qe14uaz4ybz2Sn3ZKdxJKeyZWexI+k1ZilznCv4XOw4Y2u1Xuz4Xe05H2z4JKv1aKs0qSs1Kas1H245oS76Iy63o2637S1wI696Yu+6Yy+6Y2/6Y/B6o/C6ry8vJrD68DAwJ3H7J3I7JvJ7p3J7p7J8aXK66DL8KHL76LL7arJ7q/M76zO7azT9c/Pz6/W+LHW+LLY+rrX8b3X77vY8b7Z8sPa8Mrd7snf8svg883h9M/h8MHk/8Hl/8To/9nn9dvp9d7q98/y/dDy/ezw+Ozx+Nj7//L3+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEKAH8ALAAAAAALAAwAAAd4gH+CSTs5O0mCiTIfHCIdITKJORVFXWFeRhc5gg8zSlhZV0w6EX8KFi9ASEtIQjYbCwUaKDc/Qz44Lh4HABgkND1EPDUlGQMBECdHT1BNQSkTAiAEMVFUVVNOMAYgfwgmVltcWlIqCYkMI2BiXysOiYIsEg0ULYmBADs%3D)

新写法,减少Http请求数,但是只有高版本浏览器才支持!

background-image:url(data:image/gif;base64,XXXX)    base64方式将本地图片添加到文档中base64转码链接:http://imgbase64.duoshitong.com/