document.getElementById('wx_share_img').style.cssText = "100%;height:100%;position:fixed;top:0;margin-left:-50%:left:50%;" document.getElementById('wx_share_img').style.zIndex = '1000'; 给一张图片加上层级,当zIndex 写在position:fixed 的前面的时候就会不起作用,必须要在定位的后面