XML technologies / SVG / Creating simple SVG graphics / Creating and formatting simple text / Adding navigation bar text

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

The navigation bars still need text. Insert a separate <text> tag for each label so that different hyperlinks can be assigned later. To avoid formatting each text separately, group them and format the entire group, as the next page explains.

Start with the left navigation bar’s texts. Define them using several <text> tags spaced 30 pixels apart vertically. The code below should again be appended at the file’s end before the </svg> tag.

  <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>

The horizontal navigation bar’s code is similar, but changes horizontal positions instead.

  <text x="290" y="115">Kontakt |</text>
  <text x="341" y="115"> Impressum |</text>
  <text x="412" y="115"> Ziel der Seite |</text>
  <text x="494" y="115"> Weitere Projekte</text>

Note:
Each text element’s horizontal position depends on its length, requiring experimentation in a simple editor. In WebDraw, click elements and position them precisely with the arrow keys. Leading spaces provide a gap after the |, matching the gap before each separator for a consistent appearance.

   

 

 

 

back to top