Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the background color of a Leaflet popup?

I'm creating a map using Leafletjs, and I'd like to change the background color of a popup (which is currently displaying and image and a link) from white to a different color. It seems that basic background color css syntax won't cut it. Any advice? Thanks, -Scott

like image 365
Scott Avatar asked Dec 01 '22 19:12

Scott


1 Answers

After you call leaflet.css, you can include a <style> tag with the following rule to change the color of the popup and popup tip.

.leaflet-popup-content-wrapper, .leaflet-popup.tip {
  background-color: #000
}

Here's a screenshot I took after I edited background-color of a popup on Leaflet's homepage. Let me know if you have any more questions. Cheers.

enter image description here

like image 187
geraldarthur Avatar answered Dec 06 '22 18:12

geraldarthur