首先看看这行代码:

<label for='account'>帐 号</label>
<input id='account' name='account' type='text' value='' placeholder='请输入手机号/邮箱' />
<p class='help-block'>请输入您注册时的手机/邮箱</p> <label for='password'>密 码</label>
<input id='password' name='account' type='password' value='' placeholder='请输入账号密码' />
<p class='help-block'>请输入帐号密码</p> <button type='button' class='btn btn-primary'>登 录</button>

如图效果:

为了使之在同一行上,我们需要改进一下代码

<form class='form-horizontal'>
<fieldset>
<legend>用户登录</legend>
<div class='control-group'>
<label class='control-label' for='account'>帐 号</label>
<div class='controls'>
<input id='account' name='account' type='text' value='' placeholder='请输入手机号/邮箱' />
<p class='help-block'>请输入您注册时的手机/邮箱</p>
</div>
</div> <div class='control-group'>
<label class='control-label' for='password'>密 码</label>
<div class='controls'>
<input id='password' name='account' type='password' value='' placeholder='请输入账号密码' />
<p class='help-block'>请输入帐号密码</p>
</div>
</div>
</fieldset>
<div class='form-actions'>
 <button type='submit' class='btn btn-primary'>登 录</button>
</div>
</form>

说明:

  legend标签:定义表单描述,且下方会有灰色的线

  .form-actions: 灰色背景和适当的边距

  .controls:包围住表单元素

  .control-label:如果要使“密码”文字和文本框在同一线上,需要给“密码”外围的lable添加.control-label类,同时需要给文本框和提示文字外围包围一个类为.cnotrols的div

效果如图:

Bootstrap页面布局12 - BS表单元素的排版的更多相关文章

  1. Bootstrap页面布局11 - BS表单

    表单之 文本框 text <input type='text' value='' placeholder='输入您的用户名' class='input-mini' /> ①几个类控制文本框 ...

  2. 2017年12月17日 ASP.NET 12个表单元素&&简单控件/复合控件

    12个表单元素可以分为三大类 第一类:文本类 <input type = "text" /> //普通文本框 <input type = "passwo ...

  3. HTML——超文本标记语言(表单及12个表单元素)

    表单 格式: <form action=" " method="get/post"  placehoder=" "></f ...

  4. Bootstrap页面布局3 - BS布局以及流动布局

    1. <h1 class='page-header'>布局<small> 使用bootstrap网格系统布局网页</small></h1> 得到如图所示 ...

  5. Bootstrap页面布局16 - BS导航菜单和其响应式布局以及导航中的下拉菜单

    代码: <div class='container-fluid'> <h2 class='page-header'>导航</h2> <!-- .navrbar ...

  6. Bootstrap页面布局9 - BS列表

    列表: 无序列表(列表中项目内容没有固定的顺序), 有序列表(通常使用在一组有前后顺序的内容上), 描述列表(定义解释一组词汇) 无序列表: <ul> <li>Ueditor编 ...

  7. Bootstrap页面布局6 - BS把已有的固定宽度布局转换成响应式布局

    首先引入文件bootstrap-responsive.css <link href="bootstrap/css/bootstrap-responsive.css" rel= ...

  8. Bootstrap页面布局23 - BS折叠内容

    <div class='container-fluid'> <h3 class='page-header'>Bootstrap 折叠内容</h3> <!--如 ...

  9. Bootstrap页面布局20 - BS缩略图

    <div class='container-fluid'> <h2 class='page-header'>Bootstrap 缩略图</h2> <ul cl ...

随机推荐

  1. 基于C#语言利用Microsoft.office.introp.excel操作Excel总结

    终于解决了质量评估测试软件在任意装有excel(2010以下版本)的电脑上正常使用的问题!!!!!!!!!! 可到http://www.microsoft.com/en-sa/download/con ...

  2. android 制作自定义标题栏

    1.在AndroidManifest.xml设置主题 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 2.在l ...

  3. codeforces 385 c

    Description Recently, the bear started studying data structures and faced the following problem. You ...

  4. Xamarin.Android模拟器提示HAX kernel module is not Installed

    Xamarin.Android模拟器提示HAX kernel module is not Installed 错误信息:emulator : ERROR : x86 emulation current ...

  5. 使用C#导出MSSQL表数据Insert语句,支持所有MSSQL列属性

    在正文开始之前,我们先看一下MSSQL的两张系统表sys.objects . syscolumnsMSDN中 sys.objects表的定义:在数据库中创建的每个用户定义的架构作用域内的对象在该表中均 ...

  6. Viola Jones Face Detector

    Viola Jones Face Detector是Paul viola 和 Michael J Jones共同提出的一种人脸检测框架.它极大的提高了人脸检测的速度和准确率. 速度提升方面:利用积分图 ...

  7. BZOJ3825 : [Usaco2014 Nov]Marathon

    不跳过任何点的路程=dis(l,l+1)+dis(l+1,l+2)+...+dis(r-2,r-1)+dis(r-1,r) 要跳过一个点i,则要最小化dis(i,i+2)-dis(i,i+1)-dis ...

  8. 【转】Profiling application LLC cache misses under Linux using Perf Events

    转自:http://ariasprado.name/2011/11/30/profiling-application-llc-cache-misses-under-linux-using-perf-e ...

  9. window.open() 被拦截后的分析

    前言:此文章仅是个人工作中遇到问题后的一些记录和总结,可能毫无意义.. 事件回顾: 在开发中,PM要求在一个页面中输入多个链接然后可以一键在新窗口打开,所以就想到用window.open来实现,但是测 ...

  10. WP7:模拟开始屏幕Tile漂动效果

    在WP7手机的开始屏幕,如果你Hold住某一个瓷贴,就会发现除了你按住的那个瓷贴其他全部下沉半透明,然后开始在不停地漂来漂去~~今天来模仿一下这个效果.新建一个项目,然后在Grid里放一个ListBo ...