SVG - g (group)

About

The <g> is grouping SVG element together.

The style that you give the g element will apply the child elements, not the g element itself.

Example

<svg height="200" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Using g to inherit presentation attributes -->
  <g fill="white" stroke="green" stroke-width="5">
    <circle cx="40" cy="40" r="25" />
    <circle cx="60" cy="60" r="25" />
  </g>
</svg>

Documentation / Reference


Powered by ComboStrap