【问题标题】:How to remove rounded corners from leaflet popup如何从传单弹出窗口中删除圆角
【发布时间】:2013-12-11 21:42:38
【问题描述】:

我想让传单弹出框的边缘锐利(角)而不是圆角。我已经下载了源代码leaflet-src.js,但似乎找不到发生这种情况的地方。我找的地方在班级里:

   leaflet-popup-content-wrapper
   leaflet-popup-content
   leaflet-popup-close-button

有人知道这是在哪里发生的吗?

【问题讨论】:

    标签: javascript styles leaflet rounded-corners


    【解决方案1】:

    我没有使用leaflet.js,但这听起来更像是一个CSS问题而不是Javascript。 .leaflet-popup-content-wrapper 类有 border-radius: 12px,这似乎是相关的。 Specified here 在源中。

    【讨论】:

      【解决方案2】:

      您可以通过添加 !important 关键字来覆盖默认样式

      例如:- 将这个类放在你的页面中,这将覆盖边框样式

      .leaflet-popup-content-wrapper,.leaflet-popup-content
      {
       border-radius:0 !important;
      }
      

      多浏览器支持

       .leaflet-popup-content-wrapper,.leaflet-popup-content
       {
         -webkit-border-radius: 0 !important;
         -moz-border-radius: 0 !important;
          border-radius: 0 !important;
       }
      

      首先,您必须找到生成半径的标签并覆盖该类,您可以使用开发人员工具来识别它。

      【讨论】: