HTML5新增type类型,HTML5新增属性

 html5版本新增了很多类型,我们挑一些常用的进行展示:
详细学习地址可以参照w3c进行学习:
https://www.w3school.com.cn/html5/att_input_type.asp

<!DOCTYPE html>
<html>
        <head>
                <meta charset="UTF-8">
                <title></title>
        </head>
        <body>
                <form action="" method="get">
                        <!--email:
                                html5的类型可以增加校验
                        -->
                        <input type="email" name="email" />
                        <!--url-->
                        <input type="url" />
                        <!--color-->
                        <input type="color" />
                        <!--number:
                                min:最小值
                                max:最大值
                                step:步长
                                value:默认值:一定在步长的范围中,否则不能提交
                        -->
                        <input type="number" min="1" max="10" step="3" value="4"/>
                        <!--range-->
                        1<input type="range" min="1" max="10" name="range" step="3"/>10
                        <!--date-->
                        <input type="date" />
                        <!--month-->
                        <input type="month" />
                        <!--week-->
                        <input type="week" />
                        <!--提交按钮-->
                        <input type="submit" />
                </form>
        </body>
</html>

HTML5新增属性

<!--
                                HTML5新增属性:
                                multiple:多选
                                placehoder:默认提示
                                autofocus:自动获取焦点
                                required:必填项
                        -->
                        <input type="text" autofocus="autofocus"/>
                        <input type="text" required="required" />

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值