Buttons te a awm
Form, dialog leh thil dang danga action hrang hrang atan Bootstrap-a custom button styles hmang la, size hrang hrang, state leh thil dang tam tak support rawh.
Bootstrap hian button style hrang hrang predefined a keng tel a, pakhat zel hian semantic purpose an nei vek a, control tam zawk neih nan extra tlemte an paih lut bawk.
Assistive technology-te hnena awmzia thlentu
awmzia belhchhah nan color hman hian hmuh theiha hriattirna chauh a pe a, chu chu assistive technology hmangtute hnenah a thlen dawn lo – screen reader ang chi te. Color hmanga tarlan information chu a thupui a\ang ngeia lang (entir nan, hmuh theih thuziak), a nih loh leh kawng dang hmanga telh a nih theih nan enfiah rawh, chu chu .sr-only
class nena thup belh thuziak ang chi a ni.
Class te hi element .btn
nena hman tur atana siam a ni . <button>
Mahse, heng class te hi on <a>
or <input>
elements ah pawh i hmang thei bawk (browser thenkhat chuan rendering danglam deuh deuh an hmang thei nachungin).
<a>
In -page functionality (collapsing content ang chi) trigger nana hman elements -a button class hman hunah , tuna page chhunga page thar emaw section thar emaw link ai chuan, heng link te hi a pek tur a ni a role="button"
, an thiltum chu assistive technology ang chi te hnena a dik taka thlen theih nan screen reader te a awm bawk.
Button mamawh, mahse hefty background colors an rawn ken te kha a ni lo em ni? Default modifier class te chu .btn-outline-*
button eng pawha background image leh color zawng zawng paih vek theihna tur te nen thlak leh rawh.
Button lian zawk emaw te zawk emaw i duh em? Add .btn-lg
emaw .btn-sm
size dang atan emaw.
Block level button siam rawh—nu leh pa pakhat zau zawng zawnga huam vek—chu .btn-block
.
Active laiin buttons chu pressed (background dum zawk, border dum zawk, leh inset shadow nen) a lang ang. Pseudo-class an hman avangin s ah hian class dah belh a ngai lo<button>
. Mahse, programmatic-a state replicate a ngai a nih chuan active appearance ang chiah kha i la force thei tho .active
(leh aria-pressed="true"
attribute pawh i telh tel bawk ang).
Element disabled
eng pawhah boolean attribute dahin button te chu inactive angin siam rawh .<button>
Element hmanga disabled button te chu <a>
an awm dan a danglam deuh hlek a:
<a>
s hian attribute an support lo a , chuvangin visually disabled anga lang turin class chudisabled
i add a ngai a ni..disabled
- Nakin lawka hman theih tur style thenkhat chu
pointer-events
anchor button-a awm zawng zawng tihtawp theihna tur a awm bawk. Chu property support tu browser-ah chuan disabled cursor chu i hmu lo tak zet ang. - Disabled button-ah
aria-disabled="true"
chuan assistive technology-te hnena element dinhmun tarlanna attribute a awm tur a ni.
Link hnathawh dan tur caveat
.disabled
Class hian s-a link functionality tihtawp tumna atan a hmang a pointer-events: none
, <a>
mahse chu CSS property chu standardized a la ni lo. Chu bakah, browser that do support pointer-events: none
-ah pawh keyboard navigation chu a nghawng lo reng a, chu chu keyboard hmu thei leh assistive technology hmangtute chuan heng link te hi an la activate thei dawn tihna a ni. Chuvangin him taka awm theih nan tabindex="-1"
heng link-ah hian attribute dah la (keyboard focus an dawn loh nan) custom JavaScript hmangin an functionality chu disable rawh.
Button hmangin tam zawk ti rawh. Control button state emaw toolbar ang chi component tam zawk tan button group siam emaw a ni.
data-toggle="button"
Button pakhat dinhmun toggle turin add rawh active
. Button i pre-toggling a nih chuan .active
class chu aria-pressed="true"
manual-in i add tur a ni a, <button>
.
Bootstrap .button
styles te hi element dang, <label>
s ang chi ah te pawh hman theih a ni a, checkbox emaw radio style button toggling emaw a awm thei bawk. JavaScript hmanga an toggling behavior enable turin chutiang modified buttons awmnaah chuan add la data-toggle="buttons"
, i buttons chhunga s te chu style turin add rawh. Input-powered button pakhat emaw, group hrang hrang emaw i siam thei tih hre reng ang che..btn-group
.btn-group-toggle
<input>
Heng button te tana checked state hi button -a event kaltlangin chauh update aclick
ni. Input update nan method dang i hman chuan—eg, <input type="reset">
input-a property chu manual-a apply-in emaw, manual-a apply-in emaw—manual checked
-a i toggle a ngai .active
ang <label>
.
.active
Pre-checked buttons ah chuan input's ah class chu manual add a ngai tih hre reng ang che <label>
.
Tihdan | Hrilhfiahna |
---|---|
$().button('toggle') |
Push state a tidanglam. Button chu a activate tawh angin a lang. |
$().button('dispose') |
Element pakhat button a tichhia. |