《HTML常用标签》

2021-08-17  本文已影响0人  Yandhi233

a 标签的用法

示例:

  <a href = "https://www.baidu.com/" target="_blank"> 百度 </a>
属性:
  1. href: 规定链接的目标 URL;
    href 取值:

    网址:https://www.google.com; http://www.google.com; //google.com
    路径: /a/b/c 以及 a/b/c; index.html 以及 ./index.html
    伪协议: javascript:代码; mailto:邮箱; tel:手机号
    id: href = #xxx

<a href="#">top</a>  点击后页面会刷新并且会回到顶部,也可以绑定id跳转到指定位置
<a href="javascript: ;">  查看</a> 点击之后没有反应页面也不会刷新,内部也不会跳转
  1. target: 规定在何处打开目标 URL。仅在 href 属性存在时使用

    _blank:新窗口打开。
    _parent:在父窗口中打开链接。
    _self:默认,当前页面跳转。
    _top:在当前窗体打开链接,并替换当前的整个窗体(框架页)。

  2. download: 指定下载链接,提示用户将其保存至本地文件。

  3. rel:rel="noopener"指示浏览器打开链接而不授予新的浏览上下文访问打开它的文档的权限,防止window.opener被滥用。

table 标签的用法

相关标签
    <table>
        <thead>
            <tr>
                <th></th>
                <th>小明</th>
                <th>小李</th>
                <th>小王</th>
            </tr>
        <tbody>
            <tr>
                <th>语文</th>
                <td>80</td>
                <td>75</td>
                <td>85</td>
            </tr>
            <tr>
                <th>数学</th>
                <td>83</td>
                <td>95</td>
                <td>75</td>
            </tr>
            <tr>
                <th>英语</th>
                <td>60</td>
                <td>70</td>
                <td>80</td>
            </tr>
        <tfoot>
            <tr>
                <th>总分</th>
                <td>223</td>
                <td>240</td>
                <td>240</td>
            </tr>
        </tfoot>
        </tbody>
        </thead>
    </table>

img 标签的用法

<img src="img.jpg" alt="">
上一篇 下一篇

猜你喜欢

热点阅读