<form>
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" placeholder="请输入用户名" class="form-control" >
</div>
<div class="form-group">
<label for="passwd">密码</label>
<input type="text" id="passwd" placeholder="请输入密码" class="form-control" >
</div>
<div class="form-group">
<label for="email">邮件地址</label>
<input type="email" class="form-control" id="email" placeholder="请输入邮箱">
</div>
<div class="form-group">
<input type="submit" value="提交" class="btn btn-primary">
</div>
</form>
1. label中的for属性作用: 当鼠标点击该label时,鼠标光标会移动到id等于该for的值的元素中。
<form class="form-inline">
<form class="form-horizontal">
<div class="form-group">
<label for="username" class="col-sm-2 control-label">用户名</label>
<div class="col-sm-10 " >
<input type="text" id="username" placeholder="请输入用户名" class="form-control" >
</div>
</div>
<div class="form-group">
<label for="passwd" class="col-sm-2 control-label">密码</label>
<div class="col-sm-10 " >
<input type="text" id="passwd" placeholder="请输入密码" class="form-control" >
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-2 control-label">邮件地址</label>
<div class="col-sm-10 " >
<input type="email" class="form-control" id="email" 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">
<input type="submit" value="提交" class="btn btn-primary">
</div>
</div>
</form>
<div class="input-group">
<label class="input-group-addon">$</label>
<input type="text" class="form-control" placeholder="请输入金额">
<label class="input-group-addon">.00</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox">音乐
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox">玩游戏
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox">旅游
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="sex" value="man" checked>男
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="sex" value="woman">女
</label>
</div>
<label class="checkbox-inline">
<input type="checkbox">音乐
</label>
<label class="checkbox-inline">
<input type="checkbox">玩游戏
</label>
<label class="checkbox-inline">
<input type="checkbox">旅游
</label>
<label class="radio-inline">
<input type="radio" name="sex" value="man" checked>男
</label>
<label class="radio-inline">
<input type="radio" name="sex" value="woman">女
</label>
<select class="form-control">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<form class="form-horizontal">
<div class="form-group has-success ">
<label for="username" class="col-sm-2 control-label ">用户名</label>
<div class="col-sm-10 " >
<input type="text" id="username" placeholder="请输入用户名" class="form-control " >
</div>
</div>
<div class="form-group has-warning ">
<label for="passwd" class="col-sm-2 control-label">密码</label>
<div class="col-sm-10 " >
<input type="text" id="passwd" placeholder="请输入密码" class="form-control" >
</div>
</div>
<div class="form-group has-error">
<label for="email" class="col-sm-2 control-label">邮件地址</label>
<div class="col-sm-10 " >
<input type="email" class="form-control" id="email" placeholder="请输入邮箱">
</div>
</div>
</form>
<div class="form-group has-success has-feedback">
<label for="username" class="col-sm-2 control-label ">用户名</label>
<div class="col-sm-10 " >
<input type="text" id="username" placeholder="请输入用户名" class="form-control " >
<span class="glyphicon glyphicon-ok form-control-feedback"></span>
</div>
</div>
<input type="password" class="form-control input-lg">
<input type="password" class="form-control">
<input type="password" class="form-control input-sm">
<img src="..." alt="..." class="img-rounded">
<img src="..." alt="..." class="img-circle">
<img src="..." alt="..." class="img-thumbnail">
//响应式图片
<img src="img/pic.png" alt="图片" class="img-responsive">