HTML 5 <input> placeholder 属性
原文链接:http://www.w3school.com.cn/html5/att_input_placeholder.asp
HTML 5 <input> placeholder 属性
实例
带有 placeholder 文本的搜索字段:
<form action="demo_form.asp" method="get">
<input type="search" name="user_search"placeholder="Search W3School"
/>
<input type="submit" />
</form>
定义和用法
placeholder 属性提供可描述输入字段预期值的提示信息(hint)。
该提示会在输入字段为空时显示,并会在字段获得焦点时消失。
注释:placeholder 属性适用于以下的 <input> 类型:text, search, url, telephone, email 以及 password。
HTML 4.01 与 HTML 5 之间的差异
placeholder 属性是 HTML5 中的新属性。
语法
<input placeholder="text">
属性值
值 | 描述 |
---|---|
text | 规定用于验证输入字段的模式。 |
input:focus::-webkit-input-placeholder,textarea:focus::-webkit-input-placeholder
{
color: transparent;
}
原理为:将placeholder提供的提示信息文字的颜色设置为"transparent"(透明)。
HTML 5 <input> placeholder 属性的更多相关文章
- 改进《完美让IE兼容input placeholder属性的jquery实现》的不完美
<完美让IE兼容input placeholder属性的jquery实现>中的代码在IE9以下浏览器中会出错,原因是因为ie9以下的浏览器对input的标签的解释不同. 例如对以下文本框的 ...
- input placeholder属性 样式修改(颜色,大小,位置)
placeholder属性 样式修改 <!DOCTYPE html> <html> <head> <meta charset="utf-8" ...
- 完美让IE兼容input placeholder属性的jquery实现
调用时直接引用jquery与下面的js就行了,相对网上的大多数例子来说,这个是比较完美的方案. /* * 球到西山沟 * http://www.cnzj5u.com * 2014/11/26 12:1 ...
- HTML 5 <input> placeholder 属性 实现搜索框提示文字点击输入后消失
H5之前要实现这个功能还要用到JS,H5出来之后新增加了placeholder属性,有了这个属性就就能轻松实现这个功能. 定义和用法 placeholder 属性提供可描述输入字段预期值的提示信息(h ...
- Html5 input placeholder 属性字体颜色修改。
这篇文章主要介绍了有关HTML5 input placeholder 颜色修改方面的知识,需要的朋友可以参考下 Chrome支持input=[type=text]占位文本属性,但下列CSS样式 ...
- HTML <input> placeholder 属性
css ::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #909; } :-moz-placeholder { /* Mo ...
- input placeholder属性IE、360浏览器兼容性问题
效果:http://hovertree.com/texiao/jquery/43/ 效果二:http://hovertree.com/texiao/jquery/43/1/ 请在IE中体验. 1.创建 ...
- html5 <input> placeholder 属性
带有 placeholder 文本的搜索字段: <form action="demo_form.asp" method="get"> <inp ...
- input 的 placeholder属性在IE8下的兼容处理
placeholder是input标签的新属性,在使用的时候有两个问题: 1.IE8 下不兼容 处理思路: 如果浏览器不识别placeholder属性,给input添加类名placeholder,模仿 ...
随机推荐
- join的理解
thread.Join把指定的线程加入到当前线程,可以将两个交替执行的线程合并为顺序执行的线程.比如在线程B中调用了线程A的Join()方法,直到线程A执行完毕后,才会继续执行线程B. t.join( ...
- git push to nas
1 建nas目录 在nas的/volume1/git_repos目录下新建相关的目录,并在该目录下运行git init --bare cd /volume1/git_repos mkdir wifi_ ...
- phpcms v9 数据库操作函数
表明默认当前load_model('xxxx')模块所在表名xxxx 若要指定表名 则:操作在mysql.class.php中$this->db->select(...) 1.查询 $ ...
- You Can Do Research Too
You Can Do Research Too I was recently discussing gatekeeping and the process of getting started in ...
- fileinput模块
刚才练习的时候,报如下错误: AttributeError: module 'fileinput' has no attribute 'input',后来Google参考这篇文章https://mai ...
- zepto.js的事件处理
能够深入理解zepto对事件的处理,那么整个JS的事件处理就应该差不多合格了,事件处理是JS语言的一个难点. 1. 首先来看$.event函数. JS中有很多事件,都是已经定义好了,我们直接调用就可以 ...
- ecshop 团购-》调取评论
涉及到的文件及代码:lib_insert.php,comments.lbi,{insert name='comments' type=$type id=$id} html代码: <blockqu ...
- js数字、字符串、数组之间的转化
1.数组转字符串 var a, b; a = ,,,,); b = a.join("-"); 2.字符串转数组 var s = "abc,abcd,aaa"; ...
- Mac添加bash alias
1. vim ~/.bash_profile (无则新建) 添加 if [ -f ~/.bashrc ]; then source ~/.bashrcfi 2.vim ~/.bashrc (无则新建) ...
- Java中为什么有abstract interface 修饰类?
如果有人问你为什么有abstract interface 修饰类,答案一定是他看到的这种方式一定是反编译出来的结果.实际中abstract interface和interface修饰的类没有区别. 下 ...