按鈕是移動(dòng)app不可或缺的一部分,不同風(fēng)格的app,需要的不同按鈕的樣式。
默認(rèn)情況下,按鈕顯示樣式為:display: inline-block。
<button class="button"> Default </button> <button class="button button-light"> button-light </button> <button class="button button-stable"> button-stable </button> <button class="button button-positive"> button-positive </button> <button class="button button-calm"> button-calm </button> <button class="button button-balanced"> button-balanced </button> <button class="button button-energized"> button-energized </button> <button class="button button-assertive"> button-assertive </button> <button class="button button-royal"> button-royal </button> <button class="button button-dark"> button-dark </button>
button-block 樣式按鈕顯示為:display: block,它將完全填充父元素的寬度,包含了內(nèi)邊距屬性padding。
<button class="button button-block button-positive"> Block Button </button>
使用 button-full 類,可以讓按鈕顯示完全寬度,且不包含內(nèi)邊距padding。
<button class="button button-full button-positive"> Full Width Block Button </button>
button-large 設(shè)置為大按鈕,button-small 設(shè)置為小按鈕。
<button class="button button-small button-assertive"> Small Button </button> <button class="button button-large button-positive"> Large Button </button>
button-outline 設(shè)置背景為透明。
<button class="button button-outline button-positive"> Outlined Button </button>
button-clear 設(shè)置按鈕背景為透明,且無邊框。
<button class="button button-clear button-positive"> Clear Button </button>
我們可以在按鈕上添加圖標(biāo)。
<button class="button"> <i class="icon ion-loading-c"></i> Loading... </button> <button class="button icon-left ion-home">Home</button> <button class="button icon-left ion-star button-positive">Favorites</button> <a class="button icon-right ion-chevron-right button-calm">Learn More</a> <a class="button icon-left ion-chevron-left button-clear button-dark">Back</a> <button class="button icon ion-gear-a"></button> <a class="button button-icon icon ion-settings"></a> <a class="button button-outline icon-right ion-navicon button-balanced">Reorder</a>
頭部/底部可以添加按鈕,按鈕的樣式根據(jù)頭部/底部來設(shè)定,所以你不需要為按鈕添加額外的樣式。
<div class="bar bar-header"> <button class="button icon ion-navicon"></button> <h1 class="title">Header Buttons</h1> <button class="button">Edit</button> </div>
button-clear 類可以設(shè)置無背景和邊框的頭部/底部按鈕。
<div class="bar bar-header"> <button class="button button-icon icon ion-navicon"></button> <div class="h1 title">Header Buttons</div> <button class="button button-clear button-positive">Edit</button> </div>
<div class="button-bar"> <a class="button">First</a> <a class="button">Second</a> <a class="button">Third</a> </div>
更多建議: