XML technologies / SVG / Creating simple SVG graphics / Creating and formatting simple text / Grouping and formatting text

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

The navigation bar texts still need formatting. The easiest way is to enclose the individual text elements belonging to each navigation bar between the tags <g> and </g>. This defines an element group that you can format uniformly with a single style attribute for the group. Extend the source code as follows:

<g id="vertikal" style="font-family:'Arial Black',Helvetica;font-size:12;fill:rgb(0,0,0)">
  <text x="10" y="230">Was ist SVG?</text>
  <text x="10" y="260">SVG FAQ</text>
  <text x="10" y="290">Links</text>
  <text x="10" y="320">Beispiele</text>
  <text x="10" y="350">Editoren</text>
  <text x="10" y="380">Viewer und Tools</text>
</g>
<g id="horizontal" style="font-family:'Arial Black',Helvetica;font-size:12;fill:rgb(0,0,0)">
  <text x="290" y="115">Kontakt |</text>
  <text x="361" y="115"> Impressum |</text>
  <text x="452" y="115"> Ziel der Seite |</text>
  <text x="554" y="115"> Weitere Projekte</text>
</g>

Note:
After formatting, you may need to adjust the text positions in the horizontal navigation bar. This depends on the font and size you chose.

   

 

 

 

back to top