一、要求
新建一个
html
文件,包含:
1.
链接到外部
url
地址以新窗口打开,例如百度
http://www.baidu.com
2.
链接到本机另外一个
html
文件在当前窗口打开
3.
创建锚点,并通过链接跳转
二、代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>链接a helf</title>
</head>
<body>
<a id="top" href="#bottom">跳转底部</p>
<a href="http://www.baidu.com/" target="_self" >百度一下</a>
<br>
<a href="./day1.3.2章节练习img.html">day1.3.2章节练习</a>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<a name="bottom" href="#top">跳转顶部</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>链接a helf</title>
</head>
<body>
<a id="top" href="#bottom">跳转底部</p>
<a href="http://www.baidu.com/" target="_self" >百度一下</a>
<br>
<a href="./day1.3.2章节练习img.html">day1.3.2章节练习</a>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<a name="bottom" href="#top">跳转顶部</p>
</body>
</html>
三、效果