form标签、input和button、table标签

2018-09-18  本文已影响0人  ScottWalker

form标签:跳转页面(HTTP POST 请求)

<a href="index2.html" target="">link</a>
<iframe src="#" frameborder="0" name="xxx"></iframe>
<form action="users" method="POST" target="xxx">
  <input type="text" name="username">
  <input type="password" name="password">
  <input type="submit" value="提交">
</form>
Content-Type

input和button

<button>button</button>
<button type="button">button</button>
<input type="submit" value="button">
<input type="button" value="button">
<input type="checkbox" id="xxx"><label for="xxx">自动登录</label>
或
<label>用户名<input type="text" name="username"></label>
<label>密码<input type="password" name="password"></label>
<label><input type="checkbox" name="login" value="autologin">自动登录</label>
<label><input type="checkbox" name="login" value="password">记住密码</label>
<label><input type="radio" name="owner" value="yes">Yes</label>
<label><input type="radio" name="owner" value="no">No</label>
<select name="group" multiple>
  <option value="">-</option>
  <option value="1">第一组</option>
  <option value="2">第二组</option>
  <option value="3" disabled>第三组</option>
  <option value="4" selected>第四组</option>
</select>
<textarea style="resize:none; width:300px; height:300px;" name="多行文本" cols="30" rows="10"></textarea>

区别:input没有子元素,而button有子元素(span等)

table标签:很少用

<body>
  <table>
    <thead></thead>
    <tbody></tbody>
    <tfoot></tfoot>
  </table>
</body>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <style>
    table{
      border-collapse:collapse;
    }
  </style>
</head>
<body>
  <table border=1>
    <colgroup>
      <col width=70>
      <col bgcolor=yellow width=60>
      <col width=60>
      <col width=60>     
    </colgroup>
    <thead>
      <tr>
        <th>项目</th><th>姓名</th><th>班级</th><th>分数</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th></th><td>张三</td><td>一班</td><td>94</td>        
      </tr>
      <tr>
        <th></th><td>李四</td><td>二班</td><td>96</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>
</body>
</html>
默认border
加上collapse
上一篇 下一篇

猜你喜欢

热点阅读