[color=blue]链接有两种,一种是不同页面间的链接,这种最常见。另外一种则是页内链接,我们一般称为页内锚链接。[/color]
1.加锚链
定义好“锚”以后,将链接指向锚位置的链接形式如下:
<a href=″#id″>....</a>,即以#再加上id格式。
如:
<a href=″#chapter1″>第一章</a>
<a href=″#chapter2″>第二章</a>
<a href=″#chapter3″>第三章</a>
..............
<div id=″chapter1″>
...第一章内容..
</div>
<div id=″chapter2″>
...第二章内容..
</div>
<div id=″chapter3″>
...第三章内容..
</div>
或者写成:
<a name=″chapter1″>
...第一章内容..
</a>
<a name=″chapter2″>
...第二章内容..
</a>
<a name=″chapter3″>
...第三章内容..
</a>
2.引用不同页面内的“锚”
可能有些朋友要问,以上加的锚链都是在同一个页面之间的,如果是一个页面中的锚链接到同站点或另一个网站的另一个页面中的锚怎么办?很简单,形式为:
<a href=″URL#id″>....</a>
如 <a href=″http://ice-cream.iteye.com/index.htm#block1″>指向地址: http://ice-cream.iteye.com/index.htm文件的第一部分</a>
[color=blue]热点map的用法[/color]
<img src="../images/test.gif" alt="广告图" usemap="#ad" />
<map name="ad">
<area shape="rect" coords="59,25,150,125" href="1.htm" title="1"/>
<area shape="rect" coords="200,25,295,125" href="2.htm" title="2"/>
</map>
shape -- 定义热点形状
shape=rect: 矩形
shape=circle:圆形
shape=poly: 多边形
coords -- 定义区域点的坐标
a.矩形:必须使用四个数字,前两个数字为左上角座标,后两个数字为右下角座标
例:<area shape=rect coords=100,50,200,75 href="URL">
b.圆形:必须使用三个数字,前两个数字为圆心的座标,最后一个数字为半径长度
例:<area shape=circle coords=85,155,30 href="URL">
c.任意图形(多边形):将图形之每一转折点座标依序填入
例:<area shape=poly coords=232,70,285,70,300,90,250,90,200,78 href="URL">
1.加锚链
定义好“锚”以后,将链接指向锚位置的链接形式如下:
<a href=″#id″>....</a>,即以#再加上id格式。
如:
<a href=″#chapter1″>第一章</a>
<a href=″#chapter2″>第二章</a>
<a href=″#chapter3″>第三章</a>
..............
<div id=″chapter1″>
...第一章内容..
</div>
<div id=″chapter2″>
...第二章内容..
</div>
<div id=″chapter3″>
...第三章内容..
</div>
或者写成:
<a name=″chapter1″>
...第一章内容..
</a>
<a name=″chapter2″>
...第二章内容..
</a>
<a name=″chapter3″>
...第三章内容..
</a>
2.引用不同页面内的“锚”
可能有些朋友要问,以上加的锚链都是在同一个页面之间的,如果是一个页面中的锚链接到同站点或另一个网站的另一个页面中的锚怎么办?很简单,形式为:
<a href=″URL#id″>....</a>
如 <a href=″http://ice-cream.iteye.com/index.htm#block1″>指向地址: http://ice-cream.iteye.com/index.htm文件的第一部分</a>
[color=blue]热点map的用法[/color]
<img src="../images/test.gif" alt="广告图" usemap="#ad" />
<map name="ad">
<area shape="rect" coords="59,25,150,125" href="1.htm" title="1"/>
<area shape="rect" coords="200,25,295,125" href="2.htm" title="2"/>
</map>
shape -- 定义热点形状
shape=rect: 矩形
shape=circle:圆形
shape=poly: 多边形
coords -- 定义区域点的坐标
a.矩形:必须使用四个数字,前两个数字为左上角座标,后两个数字为右下角座标
例:<area shape=rect coords=100,50,200,75 href="URL">
b.圆形:必须使用三个数字,前两个数字为圆心的座标,最后一个数字为半径长度
例:<area shape=circle coords=85,155,30 href="URL">
c.任意图形(多边形):将图形之每一转折点座标依序填入
例:<area shape=poly coords=232,70,285,70,300,90,250,90,200,78 href="URL">