twitter-bootstrap - 在选择下拉列表旁边垂直对齐文本(带引导程序)
问题描述
我无法让一些文本垂直居中对齐。我有一个左对齐的 H4,我在 Select 下拉列表旁边有一个右对齐的 H4,都在同一行。右侧部分工作正常(H4 在选择下拉列表旁边居中对齐),但左侧部分不是。
这是我的代码,然后是我目前拥有的图像。
<div class="clearfix">
<span class="d-flex align-items-center" style="float: left;">
<h4 class="custom-header" style="float: left;">Standings</h4>
</span>
<span class="d-flex align-items-center" style="float: right;">
<span style="float: left; height: 100%;">
<h4 class="custom-header">Year: </h4>
</span>
<span style="float: right;">
<!-- Allow user to change season -->
<select class="form-control" id="seasonSelect" onchange="location = this.options[this.selectedIndex].value;">
@foreach($seasons as $seasonRow)
@if($seasonRow->id == $season->id)
<option value="/sports/{{ $sport->url_name }}/{{ $seasonRow->name }}/" selected>{{ $seasonRow->name }}</option>
@else
<option value="/sports/{{ $sport->url_name }}/{{ $seasonRow->name }}/">{{ $seasonRow->name }}</option>
@endif
@endforeach
</select>
</span>
</span>
</div>
我能够成功地将“年份:”与“选择”下拉菜单对齐,但同样的方法似乎无法让“排名”也垂直对齐。它的左浮动 DIV 不想表现。
解决方案
推荐阅读
- reactjs - 响应式 React Playgrond:与 iframe 共享状态
- r - 根据具有重复名称的一列匹配两个文件
- vb.net - 实例化内联流(读取器/写入器)变量是个好主意吗?
- azure - 我的 ASP.NET REST 应用程序返回 400(错误请求)
- dart - 我如何创建列表的副本
当 T 是对象时在飞镖中,请参见下面的代码 - google-apps-script - 手动/以编程方式添加范围
- google-apps-script - 如何让脚本仅复制最后一行值
- c - 在 for 循环中出现转义 fgets 的问题
- python - 附加到列表时退出代码 137
- javascript - JS:在数字类上使用 querySelectorAll