用html实现最基本的表单制作

例图如下:

1.提示要写内容

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>Document</title>
  7.     <style>
  8.         table {
  9.             background-color: rgb(168, 200, 196);
  10.             opacity: 0.7;
  11.         }
  12.     </style>
  13. </head>
  14. <body>
  15.     <form action="">
  16.         <table width="600" border="1">
  17.             <tr>
  18.                 <td colspan="2" style="text-align: center; font-weight: 700;">个人信息</td>
  19.             </tr>
  20.             <td>姓名:</td>
  21.             <td><input type="text" required="required" autofocus="autofocus" autocomplete="off"></td>
  22.             </tr>
  23.             <tr>
  24.                 <td>性别:</td>
  25.                 <td>
  26.                     <input type="radio" name="sex" id="nan"><label for="nan">男 </label>
  27.                     <input type="radio" name="sex" id="nv"><label for="nv">女 </label>
  28.                 </td>
  29.             </tr>
  30.             <tr>
  31.                 <td>生日</td>
  32.                 <td>
  33.                     <input type="date" required="required">
  34.                 </td>
  35.             </tr>
  36.             <tr>
  37.                 <td>手机号</td>
  38.                 <td>
  39.                     <input type="tel" required="required">
  40.                 </td>
  41.             </tr>
  42.             <tr>
  43.                 <td>民族</td>
  44.                 <td>
  45.                     <select value="请选择....." required="required">
  46.                         <option checked="checked">汉族</option>
  47.                         <option>蒙古族</option>
  48.                         <option>回族</option>
  49.                         <option>藏族</option>
  50.                         <option>苗族</option>
  51.                         <option>满族</option>
  52.                         <option>壮族</option>
  53.                         <option>朝鲜族</option>
  54.                         <option>其他</option>
  55.                     </select>
  56.                 </td>
  57.             </tr>
  58.             <tr>
  59.                 <td>地区</td>
  60.                 <td>
  61.                     <input type="text" required="required">
  62.                 </td>
  63.             </tr>
  64.             <tr>
  65.                 <td>爱好</td>
  66.                 <td>
  67.                     <input type="checkbox">爬山<input type="checkbox">唱歌<input type="checkbox">跳舞<input
  68.                         type="checkbox">台球<input type="checkbox">游戏<input type="checkbox">其他
  69.                 </td>
  70.             </tr>
  71.             <tr>
  72.                 <td>喜欢颜色</td>
  73.                 <td>
  74.                     <input type="color">
  75.                 </td>
  76.             </tr>
  77.             <tr>
  78.                 <td>日志</td>
  79.                 <td>
  80.                     <textarea name="jieshao" id="" cols="30" rows="10"
  81.                         style="resize: none;text-indent: 2em;"></textarea>
  82.                 </td>
  83.             </tr>
  84.             <tr>
  85.                 <td>免费注册</td>
  86.                 <td><input type="submit" value="提交" style="margin-left:200px;"></td>
  87.             </tr>
  88.             <tr>
  89.                 <td></td>
  90.                 <td><input type="reset" value="重新填写" style="margin-left:190px;"></td>
  91.             </tr>
  92.         </table>
  93.     </form>
  94. </body>
  95. </html>

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值