新聞中心
Foundation 按鈕組
按鈕組
Foundation 可以在同一行內(nèi)創(chuàng)建一系列的按鈕。

三河網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站設(shè)計(jì)等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。成都創(chuàng)新互聯(lián)于2013年成立到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)。
可以使用 元素并添加 .button-group 類來創(chuàng)建按鈕組:
實(shí)例
<
ul
class=
"button-group"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
/ul
>
嘗試一下 ?
垂直按鈕組
垂直按鈕組使用 .stack 類來創(chuàng)建。注意,按鈕會(huì)跨越父元素的整個(gè)寬度:
實(shí)例
<
ul
class=
"button-group stack"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
/ul
>
嘗試一下 ?
.stack-for-small 類用于小尺寸的屏幕,按鈕有水平排列變?yōu)榇怪迸帕校?/p>
實(shí)例
<
ul
class=
"button-group stack-for-small"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
/ul
>
嘗試一下 ?
圓角按鈕組
按鈕組中使用 .radius 和 .round 類為按鈕添加圓角效果:
實(shí)例
<
ul
class=
"button-group radius"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
/ul
>
<
ul
class=
"button-group round"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
/ul
>
嘗試一下 ?
均勻延展按鈕組
.even-num 類用于在按鈕組中均勻的分配按鈕的寬度并跨越父元素 100% 寬度。
num 為按鈕組中按鈕的數(shù)量,從 1 到 8:
實(shí)例
<
ul
class=
"button-group even-3"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
/ul
>
<
ul
class=
"button-group even-5"
>
<
li
>
<
button
type=
"button"
class=
"button"
>Apple
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Samsung
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Sony
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>HTC
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>Huawei
<
/button
>
<
/li
>
<
/ul
>
<
ul
class=
"button-group even-8"
>
<
li
>
<
button
type=
"button"
class=
"button"
>A
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>B
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>C
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>D
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>E
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>F
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>G
<
/button
>
<
/li
>
<
li
>
<
button
type=
"button"
class=
"button"
>H
<
/button
>
<
/li
>
<
/ul
>
嘗試一下 ?
下拉菜單按鈕
下拉菜單按鈕可以讓用戶選取設(shè)定好的值:
實(shí)例
<
a
href=
"#"
data-dropdown=
"id01"
class=
"button dropdown"
>Dropdown Button
<
/a
>
<
ul
id=
"id01"
data-dropdown-content class=
"f-dropdown"
>
<
li
>
<
a
href=
"#"
>Link 1
<
/a
>
<
/li
>
<
li
>
<
a
href=
"#"
>Link 2
<
/a
>
<
/li
>
<
li
>
<
a
href=
"#"
>Link 3
<
/a
>
<
/li
>
<
/ul
>
<
script
>
$(document).ready(function() {
$(document).foundation();
})
<
/script
>
嘗試一下 ?
實(shí)例解析
.dropdown 類創(chuàng)建一個(gè)下拉菜單按鈕。
使用帶有 data-dropdown="id" 屬性的按鈕或鏈接打開下拉菜單。
id 值需要與下拉菜單的內(nèi)容 (id01) 匹配。
在 中添加 .f-dropdown 類和 data-dropdown-content 屬性來創(chuàng)建下拉菜單的內(nèi)容。
最后初始化 Foundation JS。
分割按鈕
我們也可以創(chuàng)建一個(gè)分割按鈕的下拉菜單。只需要在按鈕中添加 .split 類并使用 span 元素生成一個(gè)方向箭的按鈕:
實(shí)例
<
button
class=
"button split"
>Split Button
<
span
data-dropdown=
"id01"
>
<
/span
>
<
/button
>
<
ul
id=
"id01"
data-dropdown-content class=
"f-dropdown"
>
<
li
>
<
a
href=
"#"
>Link 1
<
/a
>
<
/li
>
<
li
>
<
a
href=
"#"
>Link 2
<
/a
>
<
/li
>
<
li
>
<
a
href=
"#"
>Link 3
<
/a
>
<
/li
>
<
/ul
>
<
script
>
$(document).ready(function() {
$(document).foundation();
})
<
/script
>
嘗試一下 ?
分享名稱:創(chuàng)新互聯(lián)Foundation教程:Foundation 按鈕組
轉(zhuǎn)載來源:http://fisionsoft.com.cn/article/dpijphe.html


咨詢
建站咨詢
