VML Fill Element

This topic describes VML, a feature that is deprecated as of Windows Internet Explorer 9. Webpages and applications that rely on VML should be migrated to SVG or other widely supported standards.


As of December 2011, this topic has been archived. As a result, it is no longer actively maintained. For more information, see Archived Content. For information, recommendations, and guidance regarding the current version of Windows Internet Explorer, see Internet Explorer Developer Center.


Defines a fill for a shape.

The following attributes modify a fill.

Attribute Description
AlignShape Determines whether an image will align with a shape.
AltHRef Specifies an alternate reference for an image.
Angle Defines the angle of a gradient fill.
Aspect Specifies how the fill image aspect will be preserved.
Color Defines the color of a fill.
Color2 Defines the second color for a fill.
Colors Defines multiple colors for a gradient fill.
DetectMouseClick Determines whether a mouse click is detected.
Focus Defines the center of a linear gradient fill.
FocusPosition Defines the center of a radial gradient fill.
FocusSize Defines the focus size for a radial fill.
HRef Defines a URL to the original image file.
ID Defines a unique identifier for the fill.
Method Defines the method used to generate a gradient fill.
On Determines whether the fill wil be displayed.
Opacity Defines the transparency of a fill.
Opacity2 Defines the transparency of the second fill color.
Origin Defines the center of an image.
Position Defines the position of an image.
Size Defines the size of an image.
Src Defines the image to load for a fill.
Title Defines the title of a fill.
Type Defines the type of fill.



This element must be defined within a Shape element.

The following code shows a simple gradient fill for a shape.

   path = "m 1,1 l 1,200, 200,200, 200,1 x e">
   <v:fill type=gradient color="blue" color2="yellow"/>