精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

按鈕(Buttons)

使用Bootstrap自定義的按鈕樣式來進行表單、對話框等操作,并支持多種大小、狀態(tài)等。

示例

Bootstrap包含了幾個預定義的按鈕樣式,每個樣式都有自己的語義目的,并加入了更多的控制。

<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-light">Light</button>
<button type="button" class="btn btn-dark">Dark</button>

<button type="button" class="btn btn-link">Link</button>
向輔助技術(shù)傳達意義

使用顏色來增加意義只會提供一種視覺指示,而不會傳達給輔助技術(shù)(如屏幕閱讀器)的用戶。確保由顏色表示的信息在內(nèi)容本身(例如可見文本)中是明顯的,或者通過其他方式包含,例如使用 .visually-hidden類隱藏的其他文本。

禁止文字換行

如果不希望按鈕文本換行,可以將 .text-nowrap類添加到按鈕。在Sass中,可以將$btn-white-space: nowrap設(shè)置為禁用每個按鈕的文本換行。

按鈕標簽

.btn類設(shè)計用于button元素。但是,您也可以在a或input元素上使用這些類(盡管某些瀏覽器可能應用稍微不同的呈現(xiàn))。

在a元素上使用按鈕類來觸發(fā)頁內(nèi)功能(如折疊內(nèi)容),而不是鏈接到當前頁面中的新頁面或節(jié)時,應為這些鏈接賦予role="button"以適當?shù)貙⑵淠康膫鬟_給屏幕閱讀器等輔助技術(shù)

Link
<a class="btn btn-primary" href="#" role="button">Link</a>
<button class="btn btn-primary" type="submit">Button</button>
<input class="btn btn-primary" type="button" value="Input">
<input class="btn btn-primary" type="submit" value="Submit">
<input class="btn btn-primary" type="reset" value="Reset">

外邊框按鈕

需要一個按鈕,卻不需要它們帶來的厚重背景色?將默認修飾符類替換為.btn-outline-*類,以刪除任何按鈕上的所有背景圖像和顏色。

<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">Secondary</button>
<button type="button" class="btn btn-outline-success">Success</button>
<button type="button" class="btn btn-outline-danger">Danger</button>
<button type="button" class="btn btn-outline-warning">Warning</button>
<button type="button" class="btn btn-outline-info">Info</button>
<button type="button" class="btn btn-outline-light">Light</button>
<button type="button" class="btn btn-outline-dark">Dark</button>
有些按鈕樣式使用相對較淺的前景色,為了有足夠的對比度,只能在深色背景上使用。

Sizes

喜歡大的還是小的按鈕?添加.btn-lg or .btn-sm以獲得其他尺寸。

<button type="button" class="btn btn-primary btn-lg">Large button</button>
<button type="button" class="btn btn-secondary btn-lg">Large button</button>
<button type="button" class="btn btn-primary btn-sm">Small button</button>
<button type="button" class="btn btn-secondary btn-sm">Small button</button>

Disabled state

通過向任何button元素添加禁用的布爾屬性,使按鈕看起來不活動。禁用的按鈕具有 pointer-events: none,應用于防止觸發(fā)懸停和活動狀態(tài)。

<button type="button" class="btn btn-lg btn-primary" disabled>Primary button</button>
<button type="button" class="btn btn-secondary btn-lg" disabled>Button</button>

使用a元素禁用的按鈕的行為有些不同:

  • a不支持disabled屬性,因此必須添加.disabled類以使其在視覺上顯示為禁用。
  • 包括一些未來友好的樣式來禁用錨按鈕上的所有 pointer-events
  • 禁用的按鈕應該包含 aria-disabled="true" 屬性,以指示輔助技術(shù)的元素狀態(tài)。
<a href="#" class="btn btn-primary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Primary link</a>
<a href="#" class="btn btn-secondary btn-lg disabled" tabindex="-1" role="button" aria-disabled="true">Link</a>

disabled類使用pointer-events: none 來嘗試禁用a的鏈接功能,但是CSS屬性還沒有標準化。此外,即使在支持指針事件(none)的瀏覽器中,鍵盤導航也不會受到影響,這意味著有視力的鍵盤用戶和輔助技術(shù)用戶仍然能夠激活這些鏈接。因此,為了安全起見,除了aria-disabled="true"之外,還要在這些鏈接上包含tabindex="-1"屬性,以防止它們接收鍵盤焦點,并使用自定義JavaScript完全禁用它們的功能。

區(qū)塊按鈕

混合使用display和gap通用類別,建立跟Bootstrap 4一樣的響應式、滿版的的內(nèi)存塊級別按鈕堆疊。透過使用通用類別而非指定button class,你可以更好的控制間距、對齊以及響應式等行為。

<div class="d-grid gap-2">
<button class="btn btn-primary" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>

以下為一個響應式的示例,從垂直堆疊的按鈕群組開始,直到遇到md斷點才會把.d-grid替換為.d-md-block,進而使gap-2通用類別無效化。縮放瀏覽器的大小以觀察它們的改變。

<div class="d-grid gap-2 d-md-block">
<button class="btn btn-primary" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>

可以使用網(wǎng)格系統(tǒng)的欄(column)類別來調(diào)整內(nèi)存塊級別按鈕的寬度。舉例來說,可以用.col-6建立寬度50%的內(nèi)存塊級別按鈕,再用.mx-auto將其水平置中。

<div class="d-grid gap-2 col-6 mx-auto">
<button class="btn btn-primary" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>

方向為水平時,可以添加通用類別來對齊、調(diào)整按鈕。以下用我們前一個響應式的示例進行修改,在按鈕上加入了一些flex,margin通用類別,使其在非堆疊的情況下對齊右邊。

<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<button class="btn btn-primary me-md-2" type="button">Button</button>
<button class="btn btn-primary" type="button">Button</button>
</div>

按鈕插件

可以使用按鈕插件建立簡單的on/off切換按鈕。

視覺上,這些切換按鈕跟核取方塊切換按鈕是相同的。然而它們透過輔助性技術(shù)所傳遞的信息是不一樣的:復選框切換按鈕會被屏幕閱讀器傳達為“勾選”/“未勾選”(因為就算它們外表為按鈕,本質(zhì)上仍然是復選框);然而本節(jié)的切換按鈕則會被傳達為“按鈕”/“按下按鈕”。這兩種方法之間的選擇取決于你想要建立哪一種切換,以及此按鈕是被傳達為核取方塊還是實際按鈕這件事會不會對用戶造成影響。

切換狀態(tài)

加入data-bs-toggle="button"來切換按鈕的active狀態(tài)。如果想要預先切換按鈕狀態(tài),則必須手動添加.active以及aria-pressed="true"以確保狀態(tài)有正確的傳達至輔助性技術(shù)。

<button type="button" class="btn btn-primary" data-bs-toggle="button" autocomplete="off">Toggle button</button>
<button type="button" class="btn btn-primary active" data-bs-toggle="button" autocomplete="off" aria-pressed="true">Active toggle button</button>
<button type="button" class="btn btn-primary" disabled data-bs-toggle="button" autocomplete="off">Disabled toggle button</button>
<a href="#" class="btn btn-primary" role="button" data-bs-toggle="button">Toggle link</a>
<a href="#" class="btn btn-primary active" role="button" data-bs-toggle="button" aria-pressed="true">Active toggle link</a>
<a href="#" class="btn btn-primary disabled" tabindex="-1" aria-disabled="true" role="button" data-bs-toggle="button">Disabled toggle link</a>

方法

可以使用按鈕構(gòu)造函數(shù)創(chuàng)建按鈕實例,例如:

var button = document.getElementById('myButton')
var bsButton = new bootstrap.Button(button)
Method Description
toggle Toggles push state. Gives the button the appearance that it has been activated.
dispose Destroys an element's button. (Removes stored data on the DOM element)

For example, to toggle all buttons

var buttons = document.querySelectorAll('.btn')
buttons.forEach(function (button) {
var button = new bootstrap.Button(button)
button.toggle()
})

Sass

Variables

$btn-padding-y:               $input-btn-padding-y;
$btn-padding-x:               $input-btn-padding-x;
$btn-font-family:             $input-btn-font-family;
$btn-font-size:               $input-btn-font-size;
$btn-line-height:             $input-btn-line-height;
$btn-white-space:             null; // Set to `nowrap` to prevent text wrapping

$btn-padding-y-sm:            $input-btn-padding-y-sm;
$btn-padding-x-sm:            $input-btn-padding-x-sm;
$btn-font-size-sm:            $input-btn-font-size-sm;

$btn-padding-y-lg:            $input-btn-padding-y-lg;
$btn-padding-x-lg:            $input-btn-padding-x-lg;
$btn-font-size-lg:            $input-btn-font-size-lg;

$btn-border-width:            $input-btn-border-width;

$btn-font-weight:             $font-weight-normal;
$btn-box-shadow:              inset 0 1px 0 rgba($white, .15), 0 1px 1px rgba($black, .075);
$btn-focus-width:             $input-btn-focus-width;
$btn-focus-box-shadow:        $input-btn-focus-box-shadow;
$btn-disabled-opacity:        .65;
$btn-active-box-shadow:       inset 0 3px 5px rgba($black, .125);

$btn-link-color:              $link-color;
$btn-link-hover-color:        $link-hover-color;
$btn-link-disabled-color:     $gray-600;

// Allows for customizing button radius independently from global border radius
$btn-border-radius:           $border-radius;
$btn-border-radius-sm:        $border-radius-sm;
$btn-border-radius-lg:        $border-radius-lg;

$btn-transition:              color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;

$btn-hover-bg-shade-amount:       15%;
$btn-hover-bg-tint-amount:        15%;
$btn-hover-border-shade-amount:   20%;
$btn-hover-border-tint-amount:    10%;
$btn-active-bg-shade-amount:      20%;
$btn-active-bg-tint-amount:       20%;
$btn-active-border-shade-amount:  25%;
$btn-active-border-tint-amount:   10%;

Mixins

There are three mixins for buttons: button and button outline variant mixins (both based on $theme-colors), plus a button size mixin.

@mixin button-variant(
$background,
$border,
$color: color-contrast($background),
$hover-background: if($color == $color-contrast-light, shade-color($background, $btn-hover-bg-shade-amount), tint-color($background, $btn-hover-bg-tint-amount)),
$hover-border: if($color == $color-contrast-light, shade-color($border, $btn-hover-border-shade-amount), tint-color($border, $btn-hover-border-tint-amount)),
$hover-color: color-contrast($hover-background),
$active-background: if($color == $color-contrast-light, shade-color($background,$btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
$active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
$active-color: color-contrast($active-background),
$disabled-background: $background,
$disabled-border: $border,
$disabled-color: color-contrast($disabled-background)
) {
color: $color;
@include gradient-bg($background);
border-color: $border;
@include box-shadow($btn-box-shadow);

&:hover {
color: $hover-color;
@include gradient-bg($hover-background);
border-color: $hover-border;
}

.btn-check:focus + &,
&:focus {
color: $hover-color;
@include gradient-bg($hover-background);
border-color: $hover-border;
@if $enable-shadows {
@include box-shadow($btn-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
} @else {
// Avoid using mixin so we can pass custom focus shadow properly
      box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
}
}

.btn-check:checked + &,
.btn-check:active + &,
&:active,
&.active,
.show > &.dropdown-toggle {
color: $active-color;
background-color: $active-background;
// Remove CSS gradients if they're enabled
    background-image: if($enable-gradients, none, null);
border-color: $active-border;

&:focus {
@if $enable-shadows {
  @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5));
} @else {
  // Avoid using mixin so we can pass custom focus shadow properly
        box-shadow: 0 0 0 $btn-focus-width rgba(mix($color, $border, 15%), .5);
}
}
}

&:disabled,
&.disabled {
color: $disabled-color;
background-color: $disabled-background;
// Remove CSS gradients if they're enabled
    background-image: if($enable-gradients, none, null);
border-color: $disabled-border;
}
}
@mixin button-outline-variant(
$color,
$color-hover: color-contrast($color),
$active-background: $color,
$active-border: $color,
$active-color: color-contrast($active-background)
) {
color: $color;
border-color: $color;

&:hover {
color: $color-hover;
background-color: $active-background;
border-color: $active-border;
}

.btn-check:focus + &,
&:focus {
box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}

.btn-check:checked + &,
.btn-check:active + &,
&:active,
&.active,
&.dropdown-toggle.show {
color: $active-color;
background-color: $active-background;
border-color: $active-border;

&:focus {
@if $enable-shadows {
  @include box-shadow($btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5));
} @else {
  // Avoid using mixin so we can pass custom focus shadow properly
        box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
}
}
}

&:disabled,
&.disabled {
color: $color;
background-color: transparent;
}
}
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
padding: $padding-y $padding-x;
@include font-size($font-size);
// Manually declare to provide an override to the browser default
  @include border-radius($border-radius, 0);
}

Loops

Button variants (for regular and outline buttons) use their respective mixins with our $theme-colors map to generate the modifier classes in scss/_buttons.scss.

@each $color, $value in $theme-colors {
.btn-#{$color} {
@include button-variant($value, $value);
}
}

@each $color, $value in $theme-colors {
.btn-outline-#{$color} {
@include button-outline-variant($value);
}
}
返回頂部
精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

      国产精品久久久久久亚洲毛片| 欧美精品久久一区二区| 欧美破处大片在线视频| 一级成人国产| 国产精品毛片在线看| 久久精品国产亚洲一区二区| 欧美精品二区| 亚洲理论电影网| 亚洲综合欧美日韩| 亚洲精品中文字| 亚洲婷婷国产精品电影人久久| 亚洲丶国产丶欧美一区二区三区| 亚洲视频在线视频| 国产精品v亚洲精品v日韩精品| 最新国产成人av网站网址麻豆 | 久久国产精品一区二区| 国产精品大全| 性色av一区二区三区红粉影视| 欧美激情五月| 亚洲永久免费精品| 99精品国产99久久久久久福利| 国产精品毛片大码女人| 欧美性猛交xxxx乱大交蜜桃| 另类综合日韩欧美亚洲| 久久精品主播| 久久女同互慰一区二区三区| 亚洲午夜一区二区三区| 日韩一级精品| 中日韩美女免费视频网站在线观看| 在线成人h网| 亚洲国产高清高潮精品美女| 尤物网精品视频| 一区视频在线播放| 日韩午夜电影在线观看| 精品成人国产在线观看男人呻吟| 亚洲影视综合| 亚洲精品乱码| 欧美一级欧美一级在线播放| 久久伊人免费视频| 国产精品免费在线| 亚洲福利国产精品| 亚洲一区二区成人| 久久成人一区| 免播放器亚洲| 国产精品免费一区二区三区观看 | 一区免费观看| 99天天综合性| 欧美大胆a视频| 国产精品一区二区久激情瑜伽| 欧美美女bb生活片| 国产免费成人在线视频| 亚洲激情视频网| 久久综合九色综合欧美就去吻 | 亚洲东热激情| 久久久无码精品亚洲日韩按摩| 欧美日韩视频第一区| 国内精品模特av私拍在线观看| 亚洲免费av片| 欧美日韩蜜桃| 日韩午夜在线| 欧美伦理视频网站| 亚洲美女电影在线| 欧美日韩日本国产亚洲在线| 99国产精品久久久久老师 | 夜夜狂射影院欧美极品| 欧美成人官网二区| 亚洲风情亚aⅴ在线发布| 久久国产视频网站| 亚洲国产第一| 欧美日韩国产色站一区二区三区| 亚洲精品一区二区三区四区高清| 美女网站在线免费欧美精品| 亚洲国产日韩欧美在线动漫| 欧美阿v一级看视频| 亚洲视频一区二区在线观看 | 亚洲欧美在线看| 在线观看国产欧美| 欧美日韩国产三区| 久久精品日产第一区二区| 亚洲国产精品一区二区三区| 欧美视频二区| 久久一区二区视频| 亚洲欧美日韩精品在线| 亚洲国产成人91精品| 国产伦精品一区二区三区四区免费 | 亚洲欧美另类久久久精品2019| 国产一区二区三区在线观看网站| 米奇777超碰欧美日韩亚洲| 午夜精品影院在线观看| 亚洲作爱视频| 亚洲伦理在线| 亚洲免费av观看| 99精品福利视频| 亚洲激情欧美| 中文一区二区| 亚洲欧美日韩中文视频| 欧美一区二区三区精品| 亚洲免费视频成人| 欧美伊久线香蕉线新在线| 亚洲中无吗在线| 欧美有码在线观看视频| 欧美亚洲一区二区三区| 久久久久国产成人精品亚洲午夜| 亚洲一区二区在线观看视频| 一本色道久久综合亚洲91| 亚洲另类在线一区| 欧美福利电影网| 国产精品欧美日韩久久| 欧美日韩123| 国产精品久久毛片a| 亚洲韩国日本中文字幕| 亚洲视频图片小说| 亚洲精品视频啊美女在线直播| 欧美超级免费视 在线| 久久午夜精品一区二区| 国产欧美一区二区精品性 | 美女视频黄a大片欧美| 欧美精品久久天天躁| 国产精品一区=区| 亚洲欧洲视频在线| 欧美在线短视频| 欧美成人a∨高清免费观看| 国产精品欧美日韩一区| 极品av少妇一区二区| 一本色道久久88亚洲综合88| 久久精品一区二区国产| 国产精品久久久一区二区| 亚洲电影免费观看高清| 久久久久99| 国产亚洲人成a一在线v站| 亚洲伊人色欲综合网| 欧美日韩亚洲国产一区| 亚洲高清资源| 久久久噜噜噜| 亚洲国产精品久久人人爱蜜臀| 久久精品亚洲一区| 在线日韩日本国产亚洲| 欧美风情在线观看| 99国产麻豆精品| 久久亚洲综合色| 亚洲欧洲免费视频| 欧美亚洲动漫精品| 久久久91精品国产| 欧美视频一区二区在线观看| 国产精品萝li| 欧美成人午夜77777| 一区二区三区日韩在线观看| 国产亚洲欧美另类中文| 欧美精品一区二区三| 午夜视频一区二区| 宅男噜噜噜66国产日韩在线观看| 在线日韩av片| 国产一区欧美日韩| 久久久噜噜噜久久久| 黄色成人在线观看| 欧美性大战xxxxx久久久| 欧美在线视频免费观看| 亚洲免费av片| 亚洲国产精品悠悠久久琪琪| 国产精品美女久久福利网站| 亚洲电影免费观看高清| 久久这里只有| 最新国产成人在线观看| 99re6热只有精品免费观看| 免费亚洲视频| 亚洲尤物在线| 在线观看欧美视频| 麻豆成人91精品二区三区| 91久久黄色| 国产视频综合在线| 免费影视亚洲| 亚洲香蕉网站| 亚洲精品1234| 国产日韩综合| 欧美午夜影院| 久久久福利视频| 一本色道久久综合亚洲精品婷婷| 欧美亚洲不卡| 欧美日韩妖精视频| 免费欧美网站| 久久久久久国产精品mv| 亚洲欧美国产日韩中文字幕| 亚洲人成小说网站色在线| 国产精品一区二区男女羞羞无遮挡| 欧美日韩精品中文字幕| 麻豆精品精华液| 免费看亚洲片| 99在线|亚洲一区二区| 亚洲国产精品一区在线观看不卡 | 国产精品专区h在线观看| 欧美国产日本| 快播亚洲色图| 欧美xx视频| 欧美 日韩 国产 一区| 久久精品一区二区三区不卡牛牛| 亚洲国内精品| 亚洲精品国产精品乱码不99按摩| 黄页网站一区| 日韩小视频在线观看| 日韩视频免费|