LIS 525 - VML

VML (Vector Markup Language) (not to be confused with VRML, of which Google suggests it might be a misspelling) is a specification for displaying 2-dimensional objects on Web pages without the need to refer to additional graphics files. VML code is supported by Internet Explorer 5 and above but ignored by other browsers.

Some Web page creation tools, such as Microsoft FrontPage, allow authors to create pages on which images of simple shapes are defined in two different ways: using VML on the one hand and standard img tags on the other. People viewing the pages with later versions of Internet Explorer place less of a burden on the server, because the inline image files for the shapes do not need to be requested. Those using other browsers can still see the images, which their browsers request as separate image files. Of course, the code of the HTML file is somewhat longer, slightly increasing storage space needs (since the separate graphic files are still there) and the amount of bandwidth required to serve users with other browsers.

If your browser supports VML, you should see two ovals below, one yellow and one olive:

For Internet Explorer to recognize VML code in a page, the page needs to contain two other pieces of code (this is not pointed out until later in Microsoft's tutorial):

  1. a pointer to an appropriate XML "namespace", which may take the form of using <html xmlns:v="urn:schemas-microsoft-com:vml"> instead of just <html> at the start of the page;
  2. a "behavior style" for the v element, which may be inserted more or less anywhere before the first VML code, in the form <style>v\:* { behavior: url(#default#VML); }</style>

The actual VML code for the yellow oval shown above is

<v:oval style="width:100pt;height:25pt" fillcolor="yellow"> </v:oval>

For More Information


Last updated October 19, 2007.
This page maintained by Prof. Tim Craven
E-mail (text/plain only):
Faculty of Information and Media Studies
University of Western Ontario,
London, Ontario
Canada, N6A 5B7