Home Downloads Links Message Board News Search Engines Documentation About this Site E-Mail Me |
![]() |
Getting Ready to Do It
The SVG graphics can also be embedded in an existing HTML or XHTML document and employs the following structure:-. 1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2. <html> 3. <head> 4. <title>Object and Embed</title> 5. </head> 6. <body> 7. <object data="rect.svg" width="500" height="500" type="image/svg+xml"> 8. <embed src="rect.svg" width="500" height="500" type="image/svg+xml" /> 9. </object> 10. </body> 11. </html> Example of Embedded SVG Graphics From "SVG: The Art is in the Code" Web Reference The above is a typical XHTML document, except at lines 7, 8, and 9. The Object tags satisfy the standards, but use of both Object and Embed tags is required to correctly display in Netscape. If you are familiar with HTML pages, you will notice an additional line, being the DOCTYPE at the top. This transforms an ordinary HTML 4.0 page to XHTML 1.0. XHTML is based upon HTML, and is similarly standardised by the W3C Organisation. It is a language that differentiates between upper and lower case letters, so tags are preferable in lower case lettering. Also avoid mixing upper and lower case lettering, ie does not close , the correct tag is , that is the same lettering case as the opening. Secondly, when dealing with XHTML, attributes should all be within quotes. Thirdly, for each opening tag there should be an equal and opposite closing tag. Thus, <p> requires </p>, and so on. Some HTML tags open but do not use closing tags. Tags such as <br> and <hr> are closed by including the closing slash in the opening tag, thus <br> becomes <br /> and <hr> becomes <hr />. Next, nested tags cannot overlap. Therefore, <b>Hello <i> World</b></i> is illegal, but <b>Hello <i> World</i></b> is legal. Finally, values are required for all attributes. |