我想要改变弹出窗口的背景颜色。
我尝试了许多方法,但都没有成功。根据我的研究,我怀疑我需要进入leaflet的css中来改变背景颜色,但我不确定如何做到这一点。
这是我正在使用的函数:
def MapCircle(data_set_index):
"""
:param data_set_index: Takes input of the index that contains the relevant data needed to plot each point on
the map.
:return: returns the plots on the map.
"""
html_popup = folium.Html(**'''
<!doctype html>
<html>
<h1 style='color: red;'>{country}
<body style='color: blue;'>
</h1>
<br/>
<h1>
Cases: {cases}
</h1>
<br/>
<h1>
New Cases: {newcases}
</h1>
<br/>
</body>
</html>
'''**.format(country=data_set_index[3], cases=data_set_index[4],
newcases=data_set_index[2]), script=True)
popup_settings = folium.Popup(html_popup, max_width=300, min_width=200)
folium.Circle(location=[data_set_index[0], data_set_index[1]],
radius=80000, color='#C03A3A', fill=True,
popup=popup_settings).add_to(world_map)
我尝试了类似于以下的CSS字符串,但当然我不能通过它...
<style> .leaflet-popup-content-wrapper {background-color:black; color:white} </style>
非常感谢您的咨询!如果您在使用Python中的folium遇到了问题,我可以为您提供帮助。请问您需要什么样的指导呢?另外,以下是您提供的图片链接:
![enter image description here](https://istack.dev59.com/ZpgEY.webp)