05-a.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <!--
  10. a标签可以进行链接的跳转
  11. 属性 href 用来定义链接
  12. 可以使用相对路径
  13. 属性 target 用来定义打开的方式
  14. _blank 是在新窗口中打开
  15. -->
  16. <!-- 直接找到同级路径下的页面 此时默认使用的是 ./ -->
  17. <a id="1" href="hello.html" target="_blank"> 使用blank跳转hello </a>
  18. <!-- 换行是br 可以没有/ -->
  19. <br />
  20. <a href="hello.html" target="_self"> 使用self跳转hello </a>
  21. <br />
  22. <a href="hello.html"> 默认跳转到hello </a> <!-- 默认就是在自身窗口中打开 -->
  23. <br />
  24. <!-- 指定url地址 -->
  25. <a href="https://www.koobietech.com/#/" target="_blank">四福科技</a>
  26. <br />
  27. <!-- 找其他路径下的页面 先找到当前路径 然后再找到对应的地址-->
  28. <a href="./base/test.html" target="_blank">test.html</a>
  29. <br />
  30. <!-- 如果需要先找到上一个层级 使用 ../ -->
  31. <!-- 绝对路径 从当前位置开始找其他位置 是相对路径 否则以/开头 代表绝对路径 -->
  32. <a href="/base/test.html" target="_blank">绝对路径下的base test</a>
  33. </body>
  34. </html>