2015-07-03 126 views
0

的這個如何水平對齊一組按鈕

<div class="btn-group"> 
     <button class="btn btn-default pull-left" type="submit"><i class="glyphicon glyphicon-search"></i> Search</button> 

     <div class="divider"></div> 

     <div> 
      @Html.ActionLink("Reset filters", "Index", 
    null, 
    new { @class = "btn btn-success custom pull-left", @style = "color:white", @role = "button" } 
    ) 
     </div> 

     <button class="btn btn-default custom pull-right" type="submit"><i class="glyphicon glyphicon-file"></i> Export to Excel</button> 

    </div> 

結果是這樣的

enter image description here

我缺少什麼? 我想要左邊的兩個第一個按鈕和右邊的輸出(水平對齊)。

.divider{ 
    width:20px; 
    height:auto; 
    display:inline-block; 
} 
.custom { 
    width: 160px !important; 
} 

編輯:我的意思水平

+0

尋求調試幫助的問題(「爲什麼不是這個代碼工作?」)必須包含所需的行爲,特定的問題或錯誤以及必需的最短代碼在問題本身**中重現它**。請參閱[**如何創建最小,完整和可驗證示例**](http://stackoverflow.com/help/mcve) –

回答

0

你可能缺少的應該處理它,看到它被加載引導樣式。 或者使用類似這樣的風格並測試它的工作原理:.pull-right {float:right}

+0

我的意思是水平。然而,圖像中的結果是一樣的。我爲我的錯誤道歉。 – Aoren