使用Bootstrap 3和Rails 4在输入字段下的保证金

时间:2015-10-20 09:31:05

标签: css ruby-on-rails twitter-bootstrap input

无论我尝试什么,我都无法在输入字段下获得某个值下的边距。它应该适用于此:

input {
  margin-bottom: 5px;
}

例如它适用于50px,但我不能低于一定的余量。也尝试了!important,但这也无济于事。

这些样式正在应用。不幸的是,禁用它们不会改变边距。

*::before, *::after {
    box-sizing: border-box;
}
*::before, *::after {
    box-sizing: border-box;
}
.form-control {
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
    color: #555555;
    display: block;
    font-size: 14px;
    height: 34px;
    line-height: 1.42857;
    padding: 6px 12px;
    transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
    width: 100%;
}
input {
    margin-bottom: 5px;
}
input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
input {
    line-height: normal;
}
button, input, optgroup, select, textarea {
    color: inherit;
    font: inherit;
    margin: 0;
}
* {
    box-sizing: border-box;
}
.form-control::-moz-placeholder {
    color: #999;
    opacity: 1;
}
body {
    color: #333333;
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
    font-size: 14px;
    line-height: 1.42857;
}
html {
    font-size: 10px;
}
html {
    font-family: sans-serif;
}

html:

<div class="row">
  <div class="col-md-4">
    <div class="form-group string optional house_name">
     <label class="string optional control-label" for="house_name">Name</label>
     <input id="house_name" class="string optional form-control" type="text" value="new house" name="house[name]">
    </div>
  </div>
  <div class="col-md-4">
    <div class="form-group select optional house_region">
      <label class="select optional control-label" for="house_region_id">Region</label>
      <select id="house_region_id" class="select optional form-control" name="house[region_id]">
        <option value="">Wähle eine Region</option>
        <option value="1">Provence-Alpes-Côte d’Azur in Frankreich</option>
        <option value="2">Midi-Pyrenäen in Frankreich</option>
        <option value="3">Lombardei in Italien</option>
        <option value="4">Andalusien in Spanien</option>
      </select>
    </div>
  </div>
  <div class="col-md-4">
    <div class="form-group string optional house_htype">
      <label class="string optional control-label" for="house_htype">Typ</label>
      <input id="house_htype" class="string optional form-control" type="text" placeholder="Typ" name="house[htype]">
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

难道你不能在你的输入上放一个div并给出保证金吗?