zoukankan      html  css  js  c++  java
  • 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>

    效果:

  • 相关阅读:
    java生成验证码
    springmvc笔记(来自慕课网)
    angularJs编写多指令的情况
    四年前端开发的迷茫.
    angularJs的ui-router总结
    grunt构建前端自动化的开发环境
    socket传送文件
    socket--粘包
    socket--接受大数据
    动态导入模块
  • 原文地址:https://www.cnblogs.com/lizm166/p/9414903.html
Copyright © 2011-2022 走看看