⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 step8.html

📁 第一部分:VML入门 第一节:VML基本概念 第二节:Shape对象与VML坐标系 第三节:Line,Polyline(线)对象 第四节:Rect,RoundRect(矩形)对象
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
	<title>Thinking in VML</title>
</head>
<STYLE>
 v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="style.css" />
<body>
<table align="center">
<tr>
<td align="center" class="title"><strong>ShapeType给VML制作模版</strong></td>
</tr>
<tr>
<td >
<div class="memo" style="width:700;line-height:23px">
&nbsp;&nbsp;&nbsp;&nbsp;VML的这个功能很有用,模版,顾名思义,它可以减少书写代码的量,又使的代码可读性提高。在理解VML模版的时候,可以
和 HTML 的 CSS 一样理解,它是定义好的一种形状,下次使用的时候直接声明 type 属性就可以了。看看下面的例子:<br><br>
&lt;v:<font color=red>shapetype id="arrowUP" </font>coordsize="6 6"&gt;    &lt;!--三角形 向上--&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;v:path v="m 3,0 l 0,6,6,6,3,0 x e" /&gt;<br>
&lt;/v:shapetype&gt;<br>
&lt;v:<font color=red>shapetype id="arrowDown" </font>coordsize="6 6"&gt;  &lt;!--三角形 向下--&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;v:path v="m 0,0 l 3,6,6,0,0,0 x e" /&gt;<br>
&lt;/v:shapetype&gt;<br><br>
<v:shapetype id="arrowUP" coordsize="6 6">
	<v:path v="m 3,0 l 0,6,6,6,3,0 x e" />    
</v:shapetype>
<v:shapetype id="arrowDown" coordsize="6 6">
	<v:path v="m 0,0 l 3,6,6,0,0,0 x e" />
</v:shapetype>
&nbsp;&nbsp;&nbsp;&nbsp;定义好上面的模版后,以后就可以直接调用了:<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<v:shape type="#arrowUP" style="position:relative;width:50;height:50"/>&lt;v:shape type="<font color=red>#arrowUP</font>" style="position:relative;width:50;height:50"/&gt;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<v:shape type="#arrowDown" style="position:relative;width:50;height:50"/>&lt;v:shape type="<font color=red>#arrowDown</font>" style="position:relative;width:50;height:50"/&gt;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<v:shape type="#arrowDown" fillcolor=blue style="position:relative;width:80;height:80"/>&lt;v:shape fillcolor=blue type="<font color=red>#arrowDown</font>" style="position:relative;width:80;height:80" /&gt;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;不知道大家有没有注意到,VML里面对“,”使用不强制的,你可以使用 coordsize="6,6" 也可以使用 coordsize="6 6" ,效果是一样的。
</div>
</td>
</tr>
<tr>
<td class="title">
<p align="right"><a href="javascript:self.scrollTo(0,0)">Top</a></p>
<a href="index.html">返回目录</a><br>
上一节:<a href="step7.html">Group容器</a><br>
下一节:<a href="step21.html">脚本动态生成VML</a>
</td>
</tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -