HTML5新增标签(二)

本文详细介绍了HTML5中新增的多种元素及属性,包括表单和表格的新标签,如使用summary和caption优化表格展示,利用colgroup进行列宽设置;同时深入探讨了表单元素的增强,例如input类型的新功能,如日期选择、颜色选取等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

table新增

table新增以下标签

<table summary="财务表格" border="1"><!--summary让浏览器识别-->

    <caption>财务表格</caption>

    <colgroup>

        <col width="*"><!--*自动平均分配-->

        <col width="*">

        <col width="*">

        <col width="*">

    </colgroup>

    <tr>

        <th>1</th>

        <th>2</th>

        <th>3</th>

        <th>4</th>

    </tr>

    <tr>

        <td>01</td>

        <td>02</td>

        <td>03</td>

        <td>04</td>

    </tr>

</table>

表单新增

表单新增以下标签

姓名:<input autofocus pattern="[a-z]" id="userName" type="text" maxlength="6" placeholder="请输入姓名">

<!-- required必填项   disabled禁用项    pattern正则验证  maxlength最大长度 -->

年龄:<input type="number" max="18" min="12" step="2" >

阙值:<input type="range" id="range"  max="200" min="100" step="10" >

<!--max为最大年龄    min为最小年龄  step表示以step值进行递增-->

电话号码:<input type="tel" /> <!-- 在移动端会调用9宫格的数字键盘 -->

<!-- 只能输入数字类型 在移动端会调用9宫格的数字键盘 -->

网址:<input type="url"> <!-- 校验网址 -->

Email: <input type="email"><!-- 校验邮箱 -->

颜色:<input type="color" > <!-- 拾色器 -->    

日历1:<input type="date">    

月历1:<input type="month">    

周历1:<input type="week">    

小时历1:<input type="time">    

日历2:<input type="datetime-local"> <!-- UTC时间 -->    

<progress value="50" max="100"></progress>

<button type="submit"> 提交 </button>

 

带输入功能的下拉

<input type="text" list="name" /><!--list名须与 datalist id名一致-->

<datalist id="name">

    <option value="程序猿" />

    <option value="产品狗" />

</datalist>

 

 

转载于:https://my.oschina.net/u/2971691/blog/810087

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值