当前位置:   article > 正文

vscode——HTML基本标签A标签超级链接

vscode——HTML基本标签A标签超级链接
  1. 什么是超级链接:
  2. 1通过超级连接建立链接的关系——>从一个页面跳转另一个页面——>a标签是成对出现的——<a></a>有开始有结束——>a标签不加属性:
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="UTF-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  9. <title>超级链接</title>
  10. </head>
  11. <body>
  12. <a>超级链接</a>
  13. </body>
  14. </html>
  15. 只显示“超级链接”
  1. 2.为了实现超链接功能:
  2. 1.href属性——>填入网页地址或文件地址;
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="UTF-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  9. <title>超级链接</title>
  10. </head>
  11. <body>
  12. <a href="https://www.mi.com/seckill/">超级链接</a>
  13. </body>
  14. </html>
  15. 2.点击超级链接直接在当前页面,跳转到"指定的网页"——>在新的标签打开"指定的网页"——>
  16. target属性——>后面什么都不写页面默认替换——>target="_blank"——>在网页里新开一个标签:
  17. <!DOCTYPE html>
  18. <html lang="en">
  19. <head>
  20. <meta charset="UTF-8">
  21. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  22. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  23. <title>超级链接</title>
  24. </head>
  25. <body>
  26. <a href="https://www.mi.com/seckill/" target="_blank">超级链接</a>
  27. </body>
  28. </html>
  29. 3.在<a>可以放文字,还可以放图片</a>
  30. <!DOCTYPE html>
  31. <html lang="en">
  32. <head>
  33. <meta charset="UTF-8">
  34. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  35. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  36. <title>超级链接</title>
  37. </head>
  38. <body>
  39. <a href="https://www.mi.com/seckill/" target="_blank">
  40. <img src="bh1.png" alt="">
  41. </a>
  42. </body>
  43. </html>
  1. 3.a标签还有很重要"书签标记"也叫"锚点":
  2. 1.在html页面加行快捷写法——>br{$}*100——>br{$}*100+回车键:
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head>
  6. <meta charset="UTF-8">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  9. <title>超级链接</title>
  10. </head>
  11. <body>
  12. <a href="https://www.mi.com/seckill/" target="_blank">
  13. <img src="bh1.png" alt="">
  14. </a>
  15. <br>1
  16. <br>2
  17. <br>3
  18. <br>4
  19. <br>5
  20. <br>6
  21. <br>7
  22. <br>8
  23. <br>9
  24. <br>10
  25. <br>11
  26. <br>12
  27. <br>13
  28. <br>14
  29. <br>15
  30. <br>16
  31. <br>17
  32. <br>18
  33. <br>19
  34. <br>20
  35. <br>21
  36. <br>22
  37. <br>23
  38. <br>24
  39. <br>25
  40. <br>26
  41. <br>27
  42. <br>28
  43. <br>29
  44. <br>30
  45. <br>31
  46. <br>32
  47. <br>33
  48. <br>34
  49. <br>35
  50. <br>36
  51. <br>37
  52. <br>38
  53. <br>39
  54. <br>40
  55. <br>41
  56. <br>42
  57. <br>43
  58. <br>44
  59. <br>45
  60. <br>46
  61. <br>47
  62. <br>48
  63. <br>49
  64. <br>50
  65. <br>51
  66. <br>52
  67. <br>53
  68. <br>54
  69. <br>55
  70. <br>56
  71. <br>57
  72. <br>58
  73. <br>59
  74. <br>60
  75. <br>61
  76. <br>62
  77. <br>63
  78. <br>64
  79. <br>65
  80. <br>66
  81. <br>67
  82. <br>68
  83. <br>69
  84. <br>70
  85. <br>71
  86. <br>72
  87. <br>73
  88. <br>74
  89. <br>75
  90. <br>76
  91. <br>77
  92. <br>78
  93. <br>79
  94. <br>80
  95. <br>81
  96. <br>82
  97. <br>83
  98. <br>84
  99. <br>85
  100. <br>86
  101. <br>87
  102. <br>88
  103. <br>89
  104. <br>90
  105. <br>91
  106. <br>92
  107. <br>93
  108. <br>94
  109. <br>95
  110. <br>96
  111. <br>97
  112. <br>98
  113. <br>99
  114. <br>100
  115. </body>
  116. </html>
  1. 2.怎么加锚点——> <a href="#后面加行数"></a> ——>是通过"#"和"id"对应起——>就是重a链接调到"#后面加行数"里面去
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>超级链接</title>
  9. </head>
  10. <body>
  11. <a href="https://www.mi.com/seckill/" target="_blank">
  12. <img src="bh1.png" alt="">
  13. </a>
  14. <a href="#end">最下面</a>
  15. <br>1
  16. <br>2
  17. <br>3
  18. <br>4
  19. <br>5
  20. <br>6
  21. <br>7
  22. <br>8
  23. <br>9
  24. <br>10
  25. <br>11
  26. <br>12
  27. <br>13
  28. <br>14
  29. <br>15
  30. <br>16
  31. <br>17
  32. <br>18
  33. <br>19
  34. <br>20
  35. <br>21
  36. <br>22
  37. <br>23
  38. <br>24
  39. <br>25
  40. <br>26
  41. <br>27
  42. <br>28
  43. <br>29
  44. <br>30
  45. <br>31
  46. <br>32
  47. <br>33
  48. <br>34
  49. <br>35
  50. <br>36
  51. <br id="mid37">37
  52. <br>38
  53. <br>39
  54. <br>40
  55. <br>41
  56. <br>42
  57. <br>43
  58. <br>44
  59. <br>45
  60. <br>46
  61. <br>47
  62. <br>48
  63. <br>49
  64. <br>50
  65. <br>51
  66. <br>52
  67. <br>53
  68. <br>54
  69. <br>55
  70. <br>56
  71. <br>57
  72. <br>58
  73. <br>59
  74. <br>60
  75. <br>61
  76. <br>62
  77. <br>63
  78. <br>64
  79. <br>65
  80. <br>66
  81. <br>67
  82. <br>68
  83. <br>69
  84. <br>70
  85. <br>71
  86. <br>72
  87. <br>73
  88. <br>74
  89. <br>75
  90. <br>76
  91. <br>77
  92. <br>78
  93. <br>79
  94. <br>80
  95. <br>81
  96. <br>82
  97. <br>83
  98. <br>84
  99. <br>85
  100. <br>86
  101. <br>87
  102. <br>88
  103. <br>89
  104. <br>90
  105. <br>91
  106. <br>92
  107. <br>93
  108. <br>94
  109. <br>95
  110. <br>96
  111. <br>97
  112. <br>98
  113. <br>99
  114. <br id="end">100
  115. <a href="#mid37">mid37</a>
  116. </body>
  117. </html>
  118. 3.如果只写#——>例如:<a href="#">最顶上</a>

 

 

 

 

 最下面 









10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 mid37

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/216447
推荐阅读
相关标签