svg: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(stub with btrem's post & example!)
 
(Adds simple example of microformats in svg.)
Line 1: Line 1:
{{stub}}
{{stub}}


SVG, having a standard class attribute can also be marked up with microformats.
The [https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/class 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:
 
<source lang=html>
<svg class="h-card" viewBox="0 0 200 200" height="200" width="200">
    <circle cx="50%" cy="50%" r="100" fill="gold"/>
    <text class="p-name" x="25" y="110" font-size="30">
        Example Co.
    </text>
</svg>
</source>
 
== See also ==


Examples:
* https://btrem.com/2021/04-svg-microformats
* https://btrem.com/2021/04-svg-microformats

Revision as of 22:40, 30 November 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 class="p-name" x="25" y="110" font-size="30">
        Example Co.
    </text>
</svg>

See also