<a href="" target=""> discernible text </a>
| 类别 | 说明 |
|---|---|
| 内部页面 | about.html
./about.html ./team/about.html ../team/about.html |
| 外部页面 | https://www.baidu.com |
| 内部页面锚点 | about.html#id |
| 外部页面锚点 | https://www.baidu.com#about |
| 普通文件 | /utils/file/附件9-关于印发《广州新华学院本科教学运行管理规定》的通知.pdf |
| 图片 | .jpg
./imgs/81.jpeg |
| 音频 | ./utils/music/AvaMax-OMGWhat'sHappening.ogg |
| 视频 | ./utils/video/alizee.mp4 |
| 类别 | 说明 |
|---|---|
| _self | 当前页面加载;默认 |
| _blank | 新窗口打开;使用较多 |
| _parent | 加载到当前框架的父框架;如果没有,同_self |
| _top | 加载进入当前框架顶层/祖先;如果没有,同_self |
[] 办公文档的锚点在哪里?
<div id='cont'> 我是目标元素 </div>
<a href="#cont"> 跳转到目标元素 </a>
[] 如何实现返回顶部?
[] 如何高亮提示当前锚点?
[] 如何不遮盖导航区?
[] 如何丝滑跳转?
<a href="./greeting.html"> 目标页面 </a>
<a href="./blog.html#cont"> 目标页面某个元素 </a>
<a href="https://www.baidu.com"> 百度 </a> <a href="https://www.baidu.com#bike"> 百度百科 </a>
<a href="//www.baidu.com"> www.baidu.com </a>
| 类别 | 说明 |
|---|---|
| / | 当前页面所在网站根页面 |
| . | 当前页面所在目录根页面 |
| # | 当前页面;不重新加载 |
| 空 | 当前页面;会重新加载 |
| javascript:; | 不跳转 |
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
a {
text-decoration: none;
color: inherit;
font: inherit;
}
<a href="" target="" title="点击查看更多推荐">更多 </a>
el:target {
color: #f40;
}
[] 为什么不是给 <body> 指定行为?
html {
scroll-behavior: smooth;
}
html {
scroll-padding-top: 100px;
}
<base target="_blank">
<a href="./alizee.jpg" title="点击查看大图" target="_blank">图片预览</a>
<a href="./Alizee-La Isla Bonita.mp3" title="点击播放音乐" target="_blank">音乐预览</a>
<a href="../video/alizee.mp4" title="点击播放视频" target="_blank">视频预览</a>
<a href="./进度表.pdf">进度表.pdf</a>
<a href="./course.json">课程表.json</a>
<a href="./dom.css">base.css</a>
<a href='./Snipaste-1.16.2-x64.rar' title="单击下载" download> 截图工具Snipaste </a>
<a href='tel:13707735481'> Make a call </a>
<a href='mailTo:1942194789@qq.com'> Sending a mail </a>