0

I'm trying to style react-d3-map's marker image. There is no way to change its image (except for the change of library's code), so i'm trying to hide it and use :before pseudo element.

 <image class="icon-map-marker marker"
        xmlns:xlink="http://www.w3.org/1999/xlink"
        xlink:href="data:image/png;base64,[...]==" <!-- hardcoded in library -->
        x="141.98888888888882" y="163.8247013673872"
        height="25" width="25"
 </image>

but all the css definitions in chrome's developer's console are grayed out and of course not working - similar in FF

[class*="icon-"]:before {
  content: "0";
  min-width: 1em;
  text-align: left;
  display: inline-block;
  font-size: 18px;
}
.icon-map-marker:before {
    content: "\107F";
}

This CSS works great for HTML element. Is it all possible to create pseudo element for SVG node? Maybe some other way to change this image?

Update: I don't want to set :before on SVG element. But on image node inside SVG hierarchy.

Neevor
  • 1
  • 1
  • 9
  • 3
    @Mr_Green, I think it's the opposite here, OP wants to set `before` pseudo element **on** a SVGElement. and it's not possible though ;-) – Kaiido Sep 19 '16 at 09:23

1 Answers1

1

Pseudoelements can't be applied on <image> Tags. the specs are saying this:

Note. This specification does not fully define the interaction of :before and :after with replaced elements (such as IMG in HTML). This will be defined in more detail in a future specification.

Also see this answer

Community
  • 1
  • 1
Adrian Lambertz
  • 858
  • 6
  • 11