css - 以 Bootstrap 形式选择字段高度

标签 css twitter-bootstrap

选择字段的大小受 Bootstrap 文件的影响,如屏幕截图所示,我无法找到解决此问题的方法。

    <form>
       <div class="form-group">
       <label for="name" class="labstyle">Enter Your Name</label>
       <input type="text" class="form-control" name="name" size="20" 
        maxlength="40" placeholder="Enter You Name" required autofocus>
       </div>
           <div class="form-group">
        <label for="sell" class="labstyle">Chose Your Wish:</label>
       <select class="form-control" id="sell">
       <option value="0" hidden="hidden" disabled="" selected="">Chose Your 
        Wish</option>
       <option value="morning">Good Morning</option>
        <option value="night">Good Night</option>
     </select>
      </div>  
      <div class="form-group">
         <label for="message" class="labstyle">Message</label>
         <textarea class="form-control"  name="message" rows="3" cols="40" 
    placeholder="Optional" maxlength="92"></textarea>
      </div>
      <button type="submit" class="btn" id="btncustom">Create</button>
     </form>

Screenshot

最佳答案

添加以下将正确计算这种情况下的高度。

select.form-control:not([size]):not([multiple]) {
  height: auto!important;
}

关于css - 以 Bootstrap 形式选择字段高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47164482/

相关文章:

javascript - 查询 :contains() unable to get first text nodes in childrens

html - 如何使对象成为实体,使其不会被悬停项重叠? (CSS 和 HTML)

jquery - Twitter Bootstrap 3 中的导航栏图标位置

javascript - 如何创建嵌套的 vuetify 抽屉导航?

html - CSS 将 html 页面从黑白转换为带有 css 的颜色?

html - Material Design datatable .table-bordered 和 .table-striped 同时存在

html - 如何在 Bootstrap 中禁用 <pre> 上的样式

html - 如何在输入元素下显示搜索结果列表?

javascript - 绑定(bind)监听器以动态生成 HTML 中的内容

html - 旧浏览器的边框图像实现