Yossi
Yossi

Reputation: 392

Inline svg does not display images

I am making an svg graphics art. When it is in a seperated file, the images (using the image tag) are well displayed, but when I copy the code into an HTML page, to an svg inner tag the images disappear (only on chrome).

I suspect it is something about XML namespaces and stuff. (xlink?)

help anyone?

Upvotes: 0

Views: 374

Answers (2)

codelion
codelion

Reputation: 175

This might be a bug in the SVG parsing or rendering engine of Firefox 16 and other versions. We have SVG drawings that use the image tag for PNG files and show the PNG as expected when viewed as document by themselves. If, however, in an HTML page we use the img tag to show those very same SVG drawings then everything else in those SVG shows fine, except the SVG's image tag's PNG. I should file a bug report at Mozilla Firefox, but I haven't yet.

Upvotes: 1

Pierre
Pierre

Reputation: 35256

check that your HTML page is an xhtml page: it should be a valid XML page and have the correct namespace declarations:

<!DOCTYPE html 
      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">

  <body><svg:svg version="1.1" (...)

Upvotes: 0

Related Questions