Line Opacity Example (VML)


Purpose

This example demonstrates how to use the Opacity attribute to control the transparancy of a VML shape.

Example


 
 
 

Code

<!-- Include the VML behavior -->
<style>v\: * { behavior:url(#default#VML); display:inline-block }</style>

<!-- Declare the VML namespace -->
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />

<v:line from="20pt,10pt" to="200pt,10pt" strokecolor="red" strokeweight="2pt">
  <v:stroke opacity="25%" />
</v:line>

<v:line from="20pt,20pt" to="200pt,20pt" strokecolor="red" strokeweight="2pt">
  <v:stroke opacity="50%" />
</v:line>

<v:line from="20pt,30pt" to="200pt,30pt" strokecolor="red" strokeweight="2pt">
  <v:stroke opacity="100%" />
</v:line>