**超链接(行内元素)**
<a>一定要写点击超链接名称,可以是文字或图片</a>
属性
href
写要跳转的网页资源路径
资源:
本地资源:相对路径/绝对路径,本地的html文件
网络资源:网页的url
href='javascript:;' 表示禁止跳转
title
鼠标放置超链接显示的文字
<a href="4.html" title="4.html">跳转到图片标签</a>
target
指定要跳转的网页资源的显示位置
target="_blank"
表示在新标签页中打开
target="_self"
表示在当前标签页中打开
target="_top"
表示在顶层页面中显示,最开始的那个页面(父级的第一个)
target="_parent"
表示父级页面中显示
**代码示例:**
<html>
<head>
<title>超链接标签学习</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<h3 align="center">超链接</h3>
<hr size="30" color="coral"/>
<!--点击文字跳转,本地资源-->
<a href="4.html" title="4.html" target="_blank">跳转图片标签</a> <!--href里写要跳转的资源路径-->
<h3 align="center">点击图片标签学习超链接</h3>
<hr size="30" color="burlywood"/>
<!--点击图片跳转,本地资源-->
<a href="3.html" target="_blank"><img src="img/1.jfif" width="200px" title="跳转列表标签" /></a>
<h3 align="center">网络资源超链接</h3>
<hr size="30" color="bisque"/>
<!--网络资源-->
<a href="http://www.taobao.com" target="_blank">淘宝一下</a>
<br />
<a href="http://www.baidu.com" target="_blank"><img src="img/百度图标.png"/ title="跳转百度" width="200px"/></a>
<hr size="30" color="begge"/>
<h3 align="center">锚点学习</h3>
<!--锚点学习-->
</body>
</html>
还没有评论,来说两句吧...