Blogger Information
Blog 2
fans 0
comment 0
visits 1041
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
链接元素和表格
程坤
Original
605 people have browsed it

链接元素和表格

链接元素

链接元素<a href=""></a>

1、链接网页

  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>链接元素-链接网页</title>
  7. </head>
  8. <body>
  9. <a href="https://www.php.cn">我是一个链接,链接到网页</a>
  10. </body>
  11. </html>

2、跳转到邮箱

  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>链接元素-链接邮箱</title>
  7. </head>
  8. <body>
  9. <a href="mailto:123456@qq.com">我是一个链接,链接到邮箱</a>
  10. </body>
  11. </html>

3、跳转到电话

  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>链接元素-链接电话</title>
  7. </head>
  8. <body>
  9. <a href="tel:18012345678">我是一个链接,链接到电话</a>
  10. </body>
  11. </html>

4、跳转到本页面的锚点

  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>链接元素-跳转锚点</title>
  7. </head>
  8. <body>
  9. <a href="#anchor">我是一个链接,跳转锚点</a>
  10. <div id="anchor">我是锚点</div>
  11. </body>
  12. </html>

表格

看下面的商品信息表格

  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>表格</title>
  7. </head>
  8. <body>
  9. <table border="1" width="700" cellspacing="0" cellpadding="10" align="center">
  10. <caption style="font-size: 1.5rem; margin-bottom: 10px">
  11. 商品信息表
  12. </caption>
  13. <thead>
  14. <th>ID</th>
  15. <th>分类</th>
  16. <th>名称</th>
  17. <th>单价</th>
  18. <th>数量</th>
  19. <th>总价</th>
  20. </thead>
  21. <tbody>
  22. <tr>
  23. <td>1000</td>
  24. <td rowspan="2">电子产品</td>
  25. <td>笔记本</td>
  26. <td>5500</td>
  27. <td>2</td>
  28. <td>11000</td>
  29. </tr>
  30. <tr>
  31. <td>1001</td>
  32. <!-- <td>电子产品</td> -->
  33. <td>手机</td>
  34. <td>3000</td>
  35. <td>3</td>
  36. <td>9000</td>
  37. </tr>
  38. <tr>
  39. <td colspan="6" style="text-align: center;">分割一下</td>
  40. </tr>
  41. <tr>
  42. <td>1002</td>
  43. <td rowspan="2">家用电器</td>
  44. <td>电视机</td>
  45. <td>2000</td>
  46. <td>1</td>
  47. <td>2000</td>
  48. </tr>
  49. <tr>
  50. <td>1003</td>
  51. <!-- <td>家用电器</td> -->
  52. <td>空调</td>
  53. <td>1500</td>
  54. <td>2</td>
  55. <td>3000</td>
  56. </tr>
  57. <tr>
  58. <td colspan="6" style="text-align: center;">分割一下</td>
  59. </tr>
  60. <tr>
  61. <td>1004</td>
  62. <td>服装</td>
  63. <td>牛仔裤</td>
  64. <td>120</td>
  65. <td>2</td>
  66. <td>240</td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. </body>
  71. </html>
Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:表格中, 一定要有tbody, 这个要注意, 因为你写不写, 浏览器会自动添加的, 而js处理的目标是浏览器生成的dom对象, 所以要注意一下
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post