javascript - 更改传单弹出窗口中的行距

标签 javascript leaflet

这里有一个简单的问题:我的传单 map 弹出窗口上的间距似乎卡在双倍间距中。我试图让每条新行都像这样显示:

 Name: xxx
 Date: xxx

而不是现在的样子:

Name: xxx

Date: xxx

这是我的脚本:

function createPopup(properties, attribute, layer, radius){
//add city to popup content string
var popupContent = '<h3>' + "Name: " + properties.info_firstName + " " + properties.info_lastName + '</h3>';
//add formatted attribute to panel content 

popupContent += "<p><b>Number of Installs:</b> " + properties.GE_Count + "</p>" + "<p><b>Number of Installs:</b> " + properties.GE_Count + "</p>";


//replace the layer popup
layer.bindPopup(popupContent, {
    offset: new L.Point(0,-radius)
});
};

还有我的 CSS:

.leaflet-popup-content-wrapper {
    background-color: #e5e5e5;
    opacity: .8;
}

.leaflet-popup-tip {
    background-color: #e5e5e5;
    opacity: .8;
}

.leaflet-popup-content p, h3{
    color: #191900;
    text-align: left;
    font-family: 'Roboto Slab';
    font-size: 12px
}

提前致谢!

最佳答案

您是否尝试过添加

h3 {
  margin-top: 0;
  margin-bottom: 0;
}

到你的CSS?

关于javascript - 更改传单弹出窗口中的行距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38981934/

相关文章:

javascript - appium如何自动在textField中输入内容

javascript - 连接形状中所有点的算法

jquery - 带有 Leaflet-Awesome-Markers 的 Font-Awesome-Icons 不显示

javascript - 如何在 JQuery 中将 HTML 数据属性转换为 JSON?

javascript - 将更改数组传递给子组件@Input 字段

javascript - Leaflet.js setMaxBounds 忽略南界

javascript - leafletjs 的 map 布局

javascript - 传单编辑多边形问题

javascript - 如何在 Node.js 上加载 JSON 数据

javascript - Angular 1.5 在 ng-repeat 上隐藏重复值