Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

In order to display an SVG image on an HTML page SVG we can embed the SVG in the HTML file, we can load an external SVG file via the img tag, or we can have JavaScript code generate the SVG on-the-fly.

We can also use any of the "back-end" languages to generate the SVG code and save it on the disk later to be served by the web-server or it can send it back to the client immediately.

  • First we'll see how we can display SVG images on an HTML page.
  • Then we'll examples of some basic shapes followed by some more complex drawings.
  • After that we'll have examples generating SVG in a number of programming languages.