I use the d3-tip plugin to display tooltips for countries. Countries are an svg layer that sits on top of a Leaflet base layer. I want the tooltips to be centered in each state. What works for me now works great for all browsers except Firefox. Firefox is just the way out. I tried to configure Firefox, but it is discarded depending on the size of the browser window.
Any thoughts on how I can fix this?
Here is the plunker: https://plnkr.co/edit/1FLMkbMSZmF59dxloIlY?p=preview
Screenshot of how it looks in Firefox when it hovers over Texas: 
code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="http://d3js.org/d3.v3.min.js"></script> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet-src.js"></script> <script src="d3.tip.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <style> body{ margin: 0px; font-family:Arial, sans-serif; } #map { width: 100%; height: 100%; position:absolute; top:0; left:0; z-index:0; } path.states { fill: #ff3300; fill-opacity: .65; stroke: #fff; stroke-width: 3px;} path.states:hover { fill-opacity: 1; } .leaflet-container { background: #ccc !important; } .leaflet-right { right: 10px !important; } .leaflet-top { top: 10px !important; } .d3-tip-state { line-height:130%; font-weight: normal; font-family: Helvetica, Arial, sans-serif; font-size:13px; padding: 12px; background: rgba(205, 72, 122, 0.9); color: #fff; border-radius: 5px; position:relative; z-index:101; } @-moz-document url-prefix() { .d3-tip-state { margin-left:-100px; } } </style> </head> <body> <div id="map"></div> <script> </script> </body> </html>
source share