svg: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Changes simple example to use implied name property of h-card)
(Adds parsed json resulting from simple example)
Line 15: Line 15:
     </text>
     </text>
</svg>
</svg>
</syntaxhighlight>
Parsed JSON:
<syntaxhighlight lang="json">
{
"items": [
  {
  "type": [
    "h-card"
  ],
  "properties": {
    "name": [
    "Example Co."
    ]
  }
  }
],
"rels": {},
"rel-urls": {}
}
}
</syntaxhighlight>
</syntaxhighlight>



Revision as of 00:29, 1 December 2022

This article is a stub. You can help the microformats.org wiki by expanding it.

The class attribute is allowed on SVG elements. As such, there are rich possibilities for embedding microformats with or in them.


Example

Here is a simple example:

<svg class="h-card" viewBox="0 0 200 200" height="200" width="200">
    <circle cx="50%" cy="50%" r="100" fill="gold"/>
    <text x="25" y="110" font-size="30">
        Example Co.
    </text>
</svg>

Parsed JSON:

{
 "items": [
  {
   "type": [
    "h-card"
   ], 
   "properties": {
    "name": [
     "Example Co."
    ]
   }
  }
 ], 
 "rels": {}, 
 "rel-urls": {}
 }
}

See also