1 回答

TA貢獻1772條經驗 獲得超6個贊
經過大量的修補,我能夠弄清楚:https ://jsfiddle.net/nateomardavis/p1kwrhmv
我用CSS
img
給了它一個。background-image
然后我將熱圖圖層設置為
relative
,并將圖像圖層設置為absolute
使用解決方案HERE。最后,我使用HERE概述的方法設置圖像層 css 。
.heatmap {
background-size: contain;
background-repeat: no-repeat;
width: 100%;
height: 300%; /*if the image is bigger than screen, this is needed */
position: relative;
}
.backgroundIMG {
background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Soccer_Field_Transparant.svg/1200px-Soccer_Field_Transparant.svg.png');
background-size: contain;
background-repeat: no-repeat;
position: absolute;
width: 100%;
height: 0;
padding-top: 151.33%;
}
添加回答
舉報