Many of elements' properties in SVG
are usually declared as attributes
or properties
inside the element. F.ex width
and height
:
<svg width="500" height="300" xmlns="http://www.w3.org/2000/svg">
However, there are some properties that can be expressed as child elements. These child elements are placed directly inside the parent element they are affecting. One of these child elements is title
:
<svg width="500" height="300" xmlns="http://www.w3.org/2000/svg">
<g>
<title>SVG Title Demo example</title>
<rect x="10" y="10" width="200" height="50" />
</g>
</svg>
In this case, the title
applies to it's first parent, g
.
Does there exist a list of all parent affecting child elements like this?
I need to know when to check element's children for additional definitions.
Copyright Notice:Content Author:「W0lfw00ds」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49286877/svg-child-elements-that-affect-its-parent