We will start off with a blank, minimal .svg
image file. This will
allow us to work from the ground up building .svg images with a text editor.
Our starter SVG 1.1 image file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 500 500" width="500" height="500" id="starter_svg"> <!-- Place your SVG elements here... --> </svg>
When viewed as an image, this will just show a blank screen. However, this
starter image includes an svg
element with several important
attributes:
.svg
.Beginning with HTML5, you can mix SVG elements into your web pages. In the exercises that follow, you will set up a starter web page to do this.
starter.html
with the following content:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Embedded SVG Starter Document</title> <style type="text/css"> footer { text-align: center; } </style> </head> <body> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 500 500" width="500" height="500" id="starter_svg"> <!-- Place your SVG elements here... --> </svg> <footer> <a href="http://validator.w3.org/check/referer"> <strong> HTML </strong> Valid! </a> | <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"> <strong> CSS </strong> Valid! </a> </footer> </body> </html>This is a document which you can copy each time you want to create a new web page with an embedded SVG.
title
value to Kevin's First SVG Experiment. Check that your document passes HTML validation.