I am trying to write an SVG page where we have an icon, and on the right is dynamic text (the distance between the two is fixed). The icon has a fixed width and height, but the text can vary in width.
Both elements are surrounded by a group, and they should be concentrated there. The group also contains free text, which also has a center.
.-------------------------------------. | | | some text | | | | .----. | | | | blah blah blah blah blah | | `----Β΄ | `-------------------------------------Β΄ .-------------------------------------. | | | some text | | | | .----. | | | | blah blah blah | | `----Β΄ | `-------------------------------------Β΄
Can anyone enjoy my ASCII skills ?;)
My approach would be to compile the icon and text into one group, and then to the center of that group. Header text too.
I read that I can focus texts in a group, but I have not found a way to align images or actually groups.
<g id="MainGroup"> <text id="InfoText" x="90" y="0" width="320" text-anchor="middle" font-size="20" fill="#FFFFFF"/> <gx="90" y="0" width="320" text-anchor="middle"> <image id="UserIcon" x="0" y="25" width="48" height="48"/> <text id="Username" x="58" y="55" font-size="22" fill="#FFFFFF"/> </g> </g>
How can I do it?
Please note that I am completely new to this SVG material, so I may skip the obvious. If I missed some information, you need to ask for it.
sjngm source share