Skip navigation

Category Archives: SVG

Inline SVG that Validates

XHTML and SVG are different document types, so it’s not possible to include inline SVG documents in webpages without javascript. However it is possible to use frames to explicitly or implicitly embed SVG documents. The method is similar to embedding flash. The following is the implicit method based on the Flash Satay article.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" >
    <title>Inline SVG Example</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <meta name="robots" content="all" />
    <link rel="shortcut icon" href="favicon.ico" />

    <table border='1' cellpadding='8' cellspacing='0'>
    <td align='center' valign='top'>
    <object type='image/svg+xml' data='example.svg' width='' height=''>