帮助块类下面的Bootstrap大幅度

时间:2017-07-25 02:08:26

标签: css twitter-bootstrap

我正在使用bootstrap创建这个简单的表单,但似乎在 @RequestMapping(value = "/getData", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody List<String> getMyData(HttpServletRequest request) throws Exception { System.out.println("In MyDataController"); //not printed in IE when tested without developer tools //logic here //return statement } 类之下有很大的余量。如何在不影响响应性的情况下删除它或者我做错了什么?

.help-block
.user-help {
		background: red;
		color: white;
		text-align: center;
	}

2 个答案:

答案 0 :(得分:1)

margin-bottom: 0;应用于.user-help.form-group指定其父div类。

.form-group .user-help {
  background: red;
  color: white;
  text-align: center;
  margin-bottom: 0;
}

.form-horizontal .form-group {
  margin-bottom: 0;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<div class='container'>
  <form class='form-horizontal'>
    <div class='form-group'>
      <input id='fname' type='text' class='form-control' placeholder='First Name'>
      <div class='help-block user-help'>First name missing</div>
    </div>
    <div class='form-group'>
      <button type='submit' class='btn btn-primary btn-block'>Sign Up</button>
    </div>
  </form>
</div>

答案 1 :(得分:0)

.help-block类下面的一大块,有两个原因:

  1. .form-group的样式有margin-bottom:15px;
  2. .help-block的样式有margin-bottom:10px;
  3. 您可以更改或删除第一个.form-group类或.help-block类的margin-bottom值。