HTML 常用的标签

1.最重要的三个标签(但都可以省略):

<html><head><body>

不过<title></title>不能省略

2.<a>(a标签和form标签都是用来发送请求的,a表爱你是get请求,form标签是post请求)

<a href="http://qq.com" target="_blank">QQ</a>

<a href="http://qq.com" target="_self">QQ</a>

<a href="http://qq.com" target="_parent">QQ</a>

<a href="http://qq.com" target="_top">QQ</a>

<a href='url' download="filename.ext">下载</a> (download)

href支持:

(1)无协议 //qq.com

(2)?nameea

(3)想要a标签但不跳转(什么都不做):javascript伪协议<a href="javascript:;">QQ</a>

3 <form>标签:

用于发送POST请求。

1.如果form没有提交按钮就无法提交form

input有很多type:

input 的属性见:https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/Input

button 的属性见:https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/button

如果一个form只有一个按钮(没有type),会自动升级为提交按钮:

<form action="users" method="POST">

  <button>button</button>

   <label for="aaa">用户名</label> <input type="text" name="username" id="aaa">

   <label><input type="password" name="password" id="">密码</label>

   喜欢的水果

   <label><input type="checkbox" name="fruit" id="" value="orange">橘子</label>

   <label><input type="checkbox" name="fruit" id="" value="banana">香蕉</label>爱我

   <input type="radio" name="love" id="" value="yes">爱我

   <input type="radio" name="love" id="" value="no">不爱

   <select name="group" id="" multiple>

     <option value="">-</option>

     <option value="1">第一组</option>

     <option value="2">第二组</option>

     <option value="3" disabled>第三组</option>

     <option value="4" selected>第四组</option>

   </select>

   <textarea name="habit" style="resize:none; width:100px; height:50px;"></textarea>

   <input type="submit" value="提交">

</form>

4. <table>标签

<style>

table{

border-collapse:collapse;

}

</style>

<table border=1>

        <colgroup>

        <col width=100>

        <col width=200>

        <col width=90>   

      </colgroup>

      <thead>

        <tr>

          <th>项目</th>

          <th>姓名</th>

          <th>班级</th>

          <th>分数</th>

        </tr>

      </thead>

      <tbody>

        <tr>

          <th></th><td>小红</td><td>1</td><td>96</td>

        </tr>

        <tr>

          <th></th><td>小明</td><td>2</td><td>95</td>

        </tr>

        <tr>

          <th>平均分</th>

          <td></td>

          <td></td>

          <td>95</td>

        </tr>

      </tbody>

      <tfoot>

        <tr>

          <th>总分</th>

          <td></td>

          <td></td>

          <td>190</td>

        </tr>

      </tfoot>

    </table>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • iframe 标签 嵌套页面 a 标签 跳转页面(HTTP GET 请求) 属性见 MDN:https://dev...
    爱斯基摩白阅读 197评论 0 0
  • iframe标签 iframe 与 a标签结合使用 a标签 a标签的属性详见 a标签的target属性 a标签的h...
    小白兔养家阅读 238评论 0 1
  • 1、iframe标签 元素表示嵌套的浏览上下文,将另一个HTML页面嵌入到当前页面中。 嵌套页面时,其默认高50p...
    彻寒寒寒寒丶阅读 468评论 0 1
  • iframe标签 :用于嵌套页面,name属性可以与a标签关联使用 a标签:target="_block"打开新页...
    谢小疯阅读 246评论 0 0
  • 月色芙·图特亚斯坦,这是我儿子的笔名。我三十一岁的时候生了他,他三十一岁的时候成了作家。他写一些我早已熟知的故事,...
    图特亚斯坦阅读 1,815评论 92 123