1.

<input id="mobile" maxlength="11>

2. input type 为 number 时,maxlength 失效

<input type="number" id="mobile" oninput="if(value.length>11)value=value.slice(0,11)">

reset 默认样式

input[type=color], input[type=date], input[type=datetime-local], input[type=datetime], input[type=email], input[type=month], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], input[type=week], select, textarea {
border: 0 none;
outline:none;
background: none;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}

input 设置长度限制 去除默认样式的更多相关文章

  1. meta设置与去除默认样式--移动端开发整理笔记(一)

    视口设置: <meta name="viewport" content="width=device-width,user-scalable=no,initial-s ...

  2. 响应式移动端去除css的hover和jq的hover还有input在苹果下的默认样式

    去除css的hover: /*直接给body添加ontouchstart*/ <body ontouchstart> 去除jq的hover: var winW01 = $(window). ...

  3. 如何更改 iOS 和安卓浏览器上的 input[type="radio"] 元素的默认样式?

    Safari 上的默认样式是这样的, 背景颜色可以使用background-color改变,但中间那个点始终无法去掉. 我查了一些jQuery插件,如iCheck.js,但是那说明写得我都看不明白,根 ...

  4. 去除input获取光标时的默认样式

    给input加上样式   outline:none;

  5. 【input】标签去除默认样式

    input{-webkit-appearance: none; -moz-appearance: none; -o-appearance: none; appearance: none;}

  6. input复选框checkbox默认样式纯css修改

    修改之前的样式  修改之后的样式 html <input type="checkbox" name="btn" id="btn1"&g ...

  7. Css:常用的去除默认样式

    *{   padding: 0;   margin: 0; } ul,ol{   list-style: none; } a,a:hover,a:link,a:visited,a:active{    ...

  8. 去掉或者修改 input、select 等表单的【默认样式 】

    隐藏input等表单的默认样式的背景: textarea,select,input{-webkit-appearance: none; -moz-appearance: none; -o-appear ...

  9. CSS去除Chrome浏览器的控件默认样式

    html的input输入框在Chrome浏览器里是有默认样式的,当它获得焦点时,即使你没有为它设置:focus时的样式,Chrome浏览器还是会给它加上蓝色的边框,今天百度找到有个方法可以去除该默认样 ...

随机推荐

  1. P2279 消防局的设立 (树形DP or 贪心)

    (点击此处查看原题) 树形DP写法 看到这个题的要求,很容易相到这是一个树形DP的问题,但是dp数组应该如何设计并转移才是关键 dp[i][0]代表当前结点可以向上覆盖2层,自身一定被覆盖dp[i][ ...

  2. 整体二分(模板一)静态区间第K大

    #define IOS ios_base::sync_with_stdio(0); cin.tie(0); #include <cstdio>//sprintf islower isupp ...

  3. 散列查找的C实现

    概念 散列查找,类似与查英文字典的过程.如果我们要查找"zoo"(key)对应的释义(value),我们不会从第一页开始逐页查找(顺序查找),而是直接根据大致的推算(Hash函数) ...

  4. 数据库分库分表策略之MS-SQL读写分离方案

    MS-SQL读写分离将从以下知识点进行展开: 以下截图内容来自博主:https://www.cnblogs.com/echosong/p/3603270.html 1.本地发布(写库如:centerd ...

  5. 08Dockerfile基本使用

    使用Dockerfile创建镜像 Dockerfile是一个文本格式的配置文件,用户可以使用Dockerfile赖快速创建自定义的镜像. Dockerfile由一行行命令组成,#开头为注释. 1:Do ...

  6. LeetCode 899. Orderly Queue

    899. Orderly Queue(有序队列) 题目: 给出了一个由小写字母组成的字符串 S.然后,我们可以进行任意次数的移动. 在每次移动中,我们选择前 K 个字母中的一个(从左侧开始),将其从原 ...

  7. C语言 读取配置文件

    配置文件截图: 读取结果截图: 代码转自:http://www.tuicool.com/articles/Zb2iIn 附代码: // ReadConfig.cpp : 定义控制台应用程序的入口点. ...

  8. SuperMap iClient3D for WebGL 9D怎么将s3m图层的纹理变更精细些

    设置S3MTilesLayer.lodRangeScale.默认值是1,设的越小越精细,最小值是0.01.越大越模糊,最大值是100

  9. Marketing Cloud里取得系统contact数目的API

    Marketing Cloud里的Contact标准tile(下图红色tile)上是没有当前系统contact数字显示的,请对比profile tile(下图黑色tile). 客户有需求希望在Laun ...

  10. 【python+beautifulsoup4】Python中安装bs4后,pycharm报错ModuleNotFoundError: No module named 'bs4'

    本文主要分享关于在对应python版本中安装beautifulsoup之后,在代码执行时还会提示“No module named 'bs4'”的问题. 安装beautifsoup4 在命令窗口执行 p ...