Hmtl5 <input>中placeholder属性(新属性)
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属性(新属性)的更多相关文章
- input中id和name属性的区别。
input中id和name属性的区别. 做网站很久了,但到现在还没有搞明白input中name和id的区别,最近学习jquery,又遇到这个问题,就在网上搜集资料.看到这篇,就整理出来,以备后用. 可 ...
- css设置input中placeholder字体
设置input中placeholder字体颜色 input::-webkit-input-placeholder {color:@a;} input:-moz-placeholder {color:@ ...
- HTML5中input标签有用的新属性
HTML5对input增加了一些新标签,个人觉得比较常用有效的以下几个 placeholder=“请输入” 常见用于默认提示 autofocus 自动聚焦到当前输入框 maxlength=" ...
- HTML 5标签中<button>的新属性
<button> 标签HTML5 中的新属性 属性 值 描述 autofocus autofocus 规定当页面加载时按钮应当自动地获得焦点. disabled disabled 规定应该 ...
- 解决input 中placeholder的那些神坑
**昨天后台小哥哥提到placehold无法显示问题,我这边总结一下,顺便写个小文章分享给大家..** ============================================== 一 ...
- 移动端 华为手机 input中placeholder垂直居中失效
为一个app写了一个嵌套的提现页面,效果如下图 input给定宽高,给了line-heigh,在浏览器查看效果正常,placeholder内容以及光标显示都是垂直居中的, IOS显示正常, Andro ...
- 设置input中placeholder的样式(placeholder设置字体)
方法: 代码示例: .input::-webkit-input-placeholder { font-size: 3.73333333vw; color: #cccccc; } .input:-moz ...
- 修改Input中Placeholder默认提示颜色(兼容)
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #f00; } input:-moz-pl ...
- css 修改input中placeholder提示问题颜色
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: rgba(74, 87, 103, 1); ...
随机推荐
- KVC与Runtime结合使用(案例)及其底层原理
一.KVC 的用法和实践 用法 KVC(Key-value coding)键值编码,顾名思义.额,简单来说,是可以通过对象属性名称(Key)直接给属性值(value)编码(coding)“编码”可以理 ...
- Runtime 中的 _cmd、 IMP
IMP IMP-指向实际执行函数体的函数指针 #if !OBJC_OLD_DISPATCH_PROTOTYPES typedef void (*IMP)(void /* id, SEL, ... */ ...
- Angular基础---->AngularJS的使用(一)
AngularJS主要用于构建单页面的Web应用.它通过增加开发人员和常见Web应用开发任务之间的抽象级别,使构建交互式的现代Web应用变得更加简单.今天,我们就开始Angular环境的搭建和第一个实 ...
- openstack 爬坑日记
这个问题官方文档应该付全部责任. 关于 endpoint regionOne 问题 官方文档的所有endpoint 创建命令都是使用的regionOne,但是这个配置项必须和相关的组件ini 文件 ...
- 查看Oracle的redo日志切换频率
1.Oracle log 每次切换会记录到告警日志中 设想写个方案来查看log切换频率来判断Oracle log是否应该更改大小. 2.sql a.查看redo日志信息 select * from v ...
- MVC之路由
1.路由规则理解: 在MVC项目中,路由是一个独立的模块,需要引入System.Web.Routing ,路由的作用就是确定控制器和行为,同时确定其他的参数,然后将这些信息传递个相应的控制器和行为. ...
- ZOJ 3203 Light Bulb
Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow a ...
- poj3171 Cleaning Shifts【线段树(单点修改区间查询)】【DP】
Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4422 Accepted: 1482 D ...
- php安装xmlwriter遇到报错及解决方法
Q1:make的时候报' error: 'zend_class_entry' has no member named 'default_properties''错误, A:把 错误行C文件中defau ...
- (2.2)DDL增强功能-自定义函数与存储过程
1.存储过程 精华总结: 通过对比@@ERROR一般和if判断结合使用,@@TRANCOUNT和try catch块结合使用,xact_abort为on可以单独使用Xact_abort为off时,如果 ...