链接使用
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<a href="http://www.baidu.com">访问百度喔</a>
<br/>
<a href="http://www.baidu.com" target="_blank" rel="noropener noreferrer">访问也是百度啊</a>
<!--rel=“noopener"一般都是搭配target=”_blank"同时使用,因为target="_blank"也是一个安全漏洞:
新的页面可以通过window.opener访问你的窗口对象,并且它可以使用window.opener.location=newURL将您的页面
导航至不同的网址。新页面将与您的页面在同一进程上运行,如果新页面正在执行开销极大的JavaScript,您的页面
性能可能会受影响。noreferrer属性则是为了兼容旧版本的浏览器,功能是一样的。
也就是可以防钓鱼网站,网页劫持。此解释来自csdn-->
<h1>图片链接</h1>
<p>创建图片链接:
<a href="//www.runoob.com/html/html-tutorial.html">
<img border="10" src="smiley.gif" alt="图片名" width="32" height="32"></a></p>
<p>无边框的图片链接:
<a href="//www.runoob.com/html/html-tutorial.html">
<img border="0" src="smiley.gif" alt="图片名" width="32" height="32"></a></p>
<h1>当前页面链接到指定位置</h1>
<p>
<a href="#C4">查看章节 4</a>
</p>
<h2>章节 1</h2>
<p>这边显示该章节的内容……</p>
<h2>章节 2</h2>
<p>这边显示该章节的内容……</p>
<h2>章节 3</h2>
<p>这边显示该章节的内容……</p>
<h2><a id="C4">章节 4</a></h2>
<p>这边显示该章节的内容……</p>
<h1>跳出框架</h1>
<p>跳出框架?</p>
<a href="//www.runoob.com/" target="_top">点击这里!</a>
<p>
这是另一个电子邮件链接:
<a href="mailto:someone@example.com?cc=someoneelse@example.com&bcc=andsomeoneelse@example.com&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party!" target="_top">发送邮件!</a>
<!--mailto: 收件人 cc= 抄送 bcc 秘密抄送
收件人后面一定是?不管后面接的是邮件内容还是抄送的邮件地址,第二个和其他的分隔是&,同样无关内容
-->
</p>
<p>
<b>注意:</b> 单词之间的空格使用 %20 代替,以确保浏览器可以正常显示文本。
例如:我生气了,,,要写成,,,我%生%气%了
</p>
</body>
</html>