如何更改Leaflet弹出窗口的背景颜色? [英] How can I change the background color of a Leaflet popup?

查看:1264
本文介绍了如何更改Leaflet弹出窗口的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Leafletjs创建一个地图,我想将弹出窗口(当前显示的图像和链接)的背景颜色从白色更改为不同的颜色。似乎基本的背景颜色css语法不会削减它。有什么建议?
谢谢,
-Scott

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

推荐答案

调用leaflet.css后,你可以加一个< style> 标记以及以下规则来更改弹出和弹出提示的颜色。

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 {
background-color:#000
}

这是我在Leaflet主页上编辑弹出窗口的 background-color 之后拍摄的截图。如果您还有其他问题,请与我们联系。干杯。

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.

这篇关于如何更改Leaflet弹出窗口的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆