2016-02-23

HTML - Use/call an SVG/symbol/path to create an HTML element (without having to repeat the SVG path)

1. Utilize the "use" element, to call an existing "symbol" with your svp/path/vector.
<svg><use xlink:href="#SYMBOL-ID"></use></svg>

2. This is a symbol example... a vector/path with an icon.
<symbol viewBox="0 0 39 39" id="SYMBOL-ID">
    <title>SYMBOL-TITLE</title>
    <path
        d="M14.78 8.07c-.104-... ETC-THE-REST-OF-YOUR-VECTOR-PATH..."
    />
</symbol>

No comments:

Post a Comment