《HTML常用标签》

118 阅读1分钟
《HTML常用标签》
  1. a标签的用法

    • href

      (hyper reference)
      1. 网址
        1. http://baidu.com
        2. https://baidu.com
        3. //baidu.com
      2. 路径
        1. /a/b/c.html
        2. a/b/c.html
        3. index.html
        4. ./index.html
      3. 伪协议
        1. javascript:代码;
        2. mailto:邮箱
        3. tal:号码
      4. id
        1. href="#xxx"
    • target

      1. _blank 在新窗口打开
      2. _parent 在上层窗口打开
      3. _top 在顶层窗口打开
      4. _self 在当前窗口打开
    • download


      属性表明当前链接用于下载,而不是跳转到另一个 URL。
    • rel=noopener


      告诉浏览器打开链接时,不让链接窗口通过 JavaScript 的`window.opener`属性引用原始窗口,这样就提高了安全性。
  2. img标签的用法

    • src 发出get请求,展示一张图片
    • alt 图片不显示时,显示文字
    • height 图片高度
    • width 图片宽度
  3. table标签的用法

    • thead 头部
    • tbody 身体
    • tfoot 脚部

    table.png

    注:'thead','tbody','tfoot'位置与顺序无关

  4. 其他

    • 眼睛要好
    • iframe标签
    • form标签