BTrem

articles tagged “svg”

Adding Microformats to SVG

Using SVG in web pages offers many advantages:

  • SVG file sizes are usually small compared to bitmapped graphics
  • it adapts well to different screen resolutions and display dimensions
  • it can be styled with CSS
  • it can be scripted
  • SVG <text> elements can be indexed by search engines

To that list, we can add one more: the ability to add microformats to embedded SVG elements.

clash of the id attributes in svg

CSS-Tricks has an article about duplicate titles and id attributes in svg. The article discusses the problems that might arise when an author is relying on title elements and id attributes for ARIA accessibility. But there's another, more fundamental problem if you insert svg code directly in an html document and end up with with duplicate id attributes. A problem that could bork how the browser renders the svg.