首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何更改Leaflet图层控件中的背景样式(css)

如何更改Leaflet图层控件中的背景样式(css)
EN

Stack Overflow用户
提问于 2019-10-06 23:09:56
回答 1查看 459关注 0票数 0

我在leaflet.css中关闭了“图层控制”的背景,但黑色的框架仍然存在。如何在css中禁用它?我将非常感谢你的回答。我添加了参数: outline: none;box-shadow: none;border: none,但它们在这里不起作用。

代码语言:javascript
复制
/* layers control */
.leaflet-control-layers {
    box-shadow: 0 0px 0px rgba(0,0,0,0.0); 
    background: solid rgba(0,0,0,0.0); 
    border-radius: 4px; 
    }
.leaflet-control-layers-toggle { 
    background-image: url("../../images/text/0_Filter.png");
    width: 106px;
    height: 22px;
    } 
.leaflet-retina .leaflet-control-layers-toggle { 
    background-image: url("../../images/text/0_Filter.png");
    background-size: 106px 22px;
    }
.leaflet-touch .leaflet-control-layers-toggle { 
    width: 106px;
    height: 22px;
    outline: none; /* test dont work*/
    box-shadow: none; /* test dont work*/
    border: none /* test dont work*/
    }
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
    display: none;
    }
.leaflet-control-layers-expanded .leaflet-control-layers-list {
    display: block;
    position: relative;
    }
.leaflet-control-layers-expanded {
    padding: 6px 10px 6px 6px;
    color: #333;
    background: #fff; 
    }
.leaflet-control-layers-scrollbar {
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 5px;
    }
.leaflet-control-layers-selector {
    margin-top: 2px;
    position: relative;
    top: 1px;
    }
.leaflet-control-layers label {
    display: block;
    }
.leaflet-control-layers-separator {
    height: 0;
    border-top: 1px solid #ddd;
    margin: 5px -10px 5px -6px;
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-07 02:55:58

根据live site的说法,在<a>标签的包装器中有一个边界。

您需要移除该边框,如下所示:

代码语言:javascript
复制
.leaflet-touch .leaflet-control-layers {
  border: none;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58258575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档