Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SVG <use> elements in Chrome not displayed
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title>Chrome use-tag bug?</title>
  7. </head>
  8. <body>
  9. <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="200px" height="200px" viewBox="0 0 200 200">
  10.     <defs>
  11.         <g id="test1">
  12.             <circle cx="100" cy="100" r="50" fill="red"/>
  13.         </g>
  14.     </defs>
  15.     <g>
  16.         <rect x="0.5" y="0.5" width="199" height="199" stroke="black" fill="none"/>
  17.         <use xlink:href="#test1" x="0" y="0"/>
  18.     </g>
  19. </svg>
  20. <p>Above is inline svg with a use tag; below is the same svg linked through an object tag. Below is correct.</p>
  21. <object data="chromeuse.svg" width="200" height="200"></object>
  22. </body>
  23. </html>