在Bootstrap中使用类的按钮类型
Bootstrap has 7 different types of buttons with contextual classes from which we can create buttons easily by using these classes (.btn-default, .btn-success, .btn-danger, .btn-primary, .btn-info, .btn-warning, .btn-link).
Bootstrap具有上下文類型的 7種不同類型的按鈕 ,我們可以通過(guò)使用這些類輕松地創(chuàng)建按鈕( .btn-default , .btn-success , .btn-danger , .btn-primary , .btn-info , .btn-警告 , .btn-link )。
Example Code:
示例代碼:
<button type="button" class="btn btn-default">Button Default</button> <button type="button" class="btn btn-primary">Button Primary</button> <button type="button" class="btn btn-success">Button Success</button> <button type="button" class="btn btn-info">Button Info</button> <button type="button" class="btn btn-warning">Button Warning</button> <button type="button" class="btn btn-danger">Button Danger</button> <button type="button" class="btn btn-link">Button Link</button>We can also make different size of buttons by using different button size classes (.btn-sm, .btn-lg, .btn-md, .btn-xs).
我們還可以通過(guò)使用不同的按鈕大小類( .btn-sm , .btn-lg , .btn-md , .btn-xs )來(lái)制作不同大小的按鈕。
Example Code:
示例代碼:
<button type="button" class="btn btn-primary btn-lg">Large button</button> <button type="button" class="btn btn-default btn-md">Mediumbutton</button> <button type="button" class="btn btn-success btn-sm">Small button </button> <button type="button" class="btn btn-danger btn-xs">extraSmall button </button>Here we also have a .btn-block level button spans the entire width of the parent element.
在這里,我們還有一個(gè).btn塊級(jí)按鈕,它跨越父元素的整個(gè)寬度。
Example Code:
示例代碼:
<button type="button" class="btn btn-primary btn-block">Button 1</button> <button type="button" class="btn btn-danger btn-lgbtn-block">Button 2</button>A button can be set to an .active class (appear pressed) or a .disabled class (unclickable) state.
可以將按鈕設(shè)置為.active類(按顯示)或.disabled類( 不可單擊)狀態(tài)。
Example Code:
示例代碼:
<button type="button" class="btn btn-primary active">Active Primary</button> <button type="button" class="btn btn-primary disabled">Disabled Primary</button>Result
結(jié)果
Conclusion:
結(jié)論:
In this article, we have learnt about different button classes with contextual class, button size class, block button classes and active & disabled classes in Bootstrap. If you have doubt/query, feel free to ask in the comment box.
在本文中,我們了解了Bootstrap中不同的按鈕類,包括上下文類 , 按鈕大小類,塊按鈕類以及活動(dòng)和禁用類 。 如果您有疑問(wèn)/疑問(wèn),請(qǐng)隨時(shí)在評(píng)論框中提問(wèn)。
翻譯自: https://www.includehelp.com/html/types-of-buttons-using-classes-in-bootstrap.aspx
總結(jié)
以上是生活随笔為你收集整理的在Bootstrap中使用类的按钮类型的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Java File类boolean is
- 下一篇: php整合支付宝,Thinkphp5.0