html - 向右浮动元素

标签 html css twitter-bootstrap twitter-bootstrap-3

代码

<div class="input-group">
  <div class="input-group-addon">
    <i class="fa fa-search"></i>
  </div>
  <input type="text" class="form-control" id="txtPreCurrentdate" data-provide="datepicker" placeholder="Enter a Start Date">
  <span class="input-group-addon">-</span>
  <input type="text" class="form-control" id="txtPostCurrentdate" data-provide="datepicker" placeholder="Enter an End Date">


  <!-- want the below section to move to the right. -->
  <div class="input-group-addon">
    <i class="fa fa-server"></i>
  </div>
  <input type="number" id="txtResltsPerPage" class="form-control" ng-model="pageSize" placeholder="Results per Page 10">
</div>

enter image description here 使用上面的代码,所有元素都会出现在彼此旁边,如上图所示。我需要最后一个 <input><div>上面代码中的元素出现在form的右侧.

最佳答案

包装这个:

<div class="input-group-addon">
             <i class="fa fa-server"></i>
</div>
<input type="number" id="txtResltsPerPage" class="form-control" ng-model="pageSize" placeholder="Results per Page 10">  

带有 <div class="pull-right"></div> , 请参阅 Docs关于助手类 float

关于html - 向右浮动元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36870713/

相关文章:

javascript - 使用不同尺寸的圆形元素的砌体布局

iphone - 当窗口低于特定宽度时导致滚动条出现的隐藏元素

python - 在 Scrapy 中使用 CSS 和 Xpath 选择器

css - 如何用CSS给首页的4 block Info设置样式?

javascript - 如何在 Bootstrap Validator 中使用 ID 或 CLASS 而不是使用名称

javascript - 使用 ng-include 包含时 HTML 标签不会出现在 DOM 中

javascript - 如何重定向iframe模式表单页面上的提交按钮上的父页面?

html - 当最大宽度改变时,CSS 过渡在左侧捕捉

html - 提交的表格未编码 +'s when using method="get"

javascript - fullcalendar 和 bootstrap 可见打印