Hmtl5 <input>中placeholder属性(新属性)

一、定义和用法

placeholder 属性提供可描述输入字段预期值的提示信息(hint)。

该提示会在输入字段为空时显示,并会在字段获得焦点时消失。

注释:placeholder 属性适用于以下的 <input> 类型:text, search, url, telephone, email 以及 password。

注意:placeholder 属性是 HTML5 中的新属性。

二、示例

代码:

<form class="form-horizontal">
<div class="control-group">
<label class="control-label" contenteditable="true" for="inputUser">用户</label>
<div class="controls">
<input id="inputUser" placeholder="User" type="text" />
</div>
</div>
<div class="control-group">
<label class="control-label" contenteditable="true" for="inputPassword">密码</label>
<div class="controls">
<input id="inputPassword" placeholder="Password" type="password" />
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox" contenteditable="true">
<input type="checkbox" /> Remember me </label>
<button class="btn" contenteditable="true" type="submit">登陆</button>
</div>
</div>
</form>

效果:

Hmtl5 <input>中placeholder属性(新属性)的更多相关文章

  1. input中id和name属性的区别。

    input中id和name属性的区别. 做网站很久了,但到现在还没有搞明白input中name和id的区别,最近学习jquery,又遇到这个问题,就在网上搜集资料.看到这篇,就整理出来,以备后用. 可 ...

  2. css设置input中placeholder字体

    设置input中placeholder字体颜色 input::-webkit-input-placeholder {color:@a;} input:-moz-placeholder {color:@ ...

  3. HTML5中input标签有用的新属性

    HTML5对input增加了一些新标签,个人觉得比较常用有效的以下几个 placeholder=“请输入” 常见用于默认提示 autofocus 自动聚焦到当前输入框 maxlength=" ...

  4. HTML 5标签中<button>的新属性

    <button> 标签HTML5 中的新属性 属性 值 描述 autofocus autofocus 规定当页面加载时按钮应当自动地获得焦点. disabled disabled 规定应该 ...

  5. 解决input 中placeholder的那些神坑

    **昨天后台小哥哥提到placehold无法显示问题,我这边总结一下,顺便写个小文章分享给大家..** ============================================== 一 ...

  6. 移动端 华为手机 input中placeholder垂直居中失效

    为一个app写了一个嵌套的提现页面,效果如下图 input给定宽高,给了line-heigh,在浏览器查看效果正常,placeholder内容以及光标显示都是垂直居中的, IOS显示正常, Andro ...

  7. 设置input中placeholder的样式(placeholder设置字体)

    方法: 代码示例: .input::-webkit-input-placeholder { font-size: 3.73333333vw; color: #cccccc; } .input:-moz ...

  8. 修改Input中Placeholder默认提示颜色(兼容)

    input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #f00; } input:-moz-pl ...

  9. css 修改input中placeholder提示问题颜色

    input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: rgba(74, 87, 103, 1); ...

随机推荐

  1. 如何让IOS中的文本实现3D效果

    本转载至 http://bbs.aliyun.com/read/181991.html?spm=5176.7114037.1996646101.25.p0So7c&pos=9       zh ...

  2. Solr服务搭建

    1.1. Solr的环境 Solr是java开发. 需要安装jdk. 安装环境Linux. 需要安装Tomcat. 1.2. 搭建步骤 第一步:把solr 的压缩包上传到Linux系统 第二步:解压s ...

  3. JS 构造图片Image对象

    var image=new Image(); image.src=""; console.log(image.width);

  4. mysql查杀会话

    root登陆mysql,查看会话(show processlist\G;): mysql> kill

  5. 系统事件管理(Events) ---- HTML5+

    模块:events Events模块管理客户端事件,包括系统事件,如扩展API加载完毕.程序前后台切换等. 比如说:网络的链接的和断开这种事件,系统从前台走到后台这种事件: 不包括:点击和滑动页面事件 ...

  6. 试验性的Numpy教程(译)

    Python中Numpy模块学习: 转自:http://my.oschina.net/u/175377/blog/74406

  7. 【巷子】---vue项目打包---基本使用---【vue】

    一.基本设置 二.打包 npm run build 三.github创建一个仓库 1.将文件上传至仓库 2.点击仓库设置 3.选择代码上传到master 4.点击地址即可预览 5.常用技巧 a.如果在 ...

  8. [NGINX] - 配置文件优化 - NGINX.CONF

    Nginx 本文主要针对公司的Nginx负载均衡配置进行解释,配置文件在最下方.因为公司没有使用PHP,所以NGINX里面并没有太多facgi模块相关优化    NGINX.CONF user   语 ...

  9. CodeForeces 25E (kmp)

    E. Test time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputst ...

  10. elk----es settings--logstash--performance---bigdesk---logstash plugin online/offline

    www.cnblogs.com/tangr206/articles/2274845.html yum timeout error(/etc/resolv.conf) elk: elasticsearc ...