zoukankan      html  css  js  c++  java
  • Bootstrap关于表单(二):水平表单

    Bootstrap框架默认的表单是垂直显示风格,但很多时候我们需要的水平表单风格标签居左,表单控件居右)

    在Bootstrap框架中要实现水平表单效果,必须满足以下两个条件:

    1、在<form>元素是使用类名“form-horizontal”。 2、配合Bootstrap框架的网格系统。(网格布局会在以后的章节中详细讲解)

    <form>元素上使用类名“form-horizontal”主要有以下几个作用: 1、设置表单控件padding和margin值。 2、改变“form-group”的表现形式,类似于网格系统的“row”。

    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
    	<title>水平表单</title>
    	<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
    </head>
    <body>
    <form class="form-horizontal" role="form">
      <div class="form-group">
        <label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
        <div class="col-sm-10">
          <input type="email" class="form-control" id="inputEmail3" placeholder="请输入您的邮箱地址">
        </div>
      </div>
      <div class="form-group">
        <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
        <div class="col-sm-10">
          <input type="password" class="form-control" id="inputPassword3" placeholder="请输入您的邮箱密码">
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <div class="checkbox">
            <label>
              <input type="checkbox"> 记住密码
            </label>
          </div>
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" class="btn btn-default">进入邮箱</button>
        </div>
      </div>
    </form>
    </body>
    </html>
    

     

  • 相关阅读:
    postgresql修改postgres用户密码
    centos7 安装netstat命令工具
    sqlplus、lsnrctl命令工具不可用(libclntsh.so.11.1)
    oracle修改数据文件目录
    oracle数据库主主复制
    Spring--quartzJob配置
    TimerTask--spring配置
    SSM+Apache shiro--ehcache缓存清理
    SSM+Apache shiro--自定义realm
    ssm+Apache shiro--配置文件
  • 原文地址:https://www.cnblogs.com/agile2011/p/4101900.html
Copyright © 2011-2022 走看看