html页面中链接的设置:
1、普通文本链接
<a href="https://github.com/YuanMa-learn/html-test" target="_parent"> 这是一个链接</a>
属性href 规定链接目标
- 属性target 定义被链接的文档在哪里显示,可取值:
- _blank
- _parent
- _self
- _top
2、图像链接
![](resource/duola.jpg)
<a href="https://github.com/YuanMa-learn/html-test">
<img src="resource/duola.jpg"></a>
图像链接与文本链接的区别是,文本区域换成了使用img标签的图片显示
3、使用name属性创建html页面中的书签
- 使用name属性在文档中创建锚
<a name="tips">创建一个锚</a>
2.创建指向该锚的链接
<a href="#tips">指向锚</a>
示例:
<p>
<a href="#ch4">chapter 5 指向一个页面内的书签</a>
</p>
<h3><a name="ch1">Chapter 1</a></h3>
<p>this is chapter 1</p>
<h3><a name="ch2">Chapter 2</a></h3>
<p>this is chapter 2</p>
<h3><a name="ch3">Chapter 3</a></h3>
<p>this is chapter 3</p>
<h3><a name="ch4">Chapter 4</a></h3>
<p>this is chapter 4</p>
<h3><a name="ch5">Chapter 5</a></h3>
<p>this is chapter 5</p>
<h3><a name="ch6">Chapter 6</a></h3>
<p>this is chapter 6</p>