新聞中心
Foundation 表單
Foundation 表單控制會(huì)自動(dòng)設(shè)置為全局樣式:

我們提供的服務(wù)有:成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、關(guān)嶺ssl等。為上千多家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的關(guān)嶺網(wǎng)站制作公司
所有 , 及 元素寬度都為 100%,且?guī)в型膺吘?、?nèi)邊距、陰影和鼠標(biāo)移動(dòng)效果。
實(shí)例
<
form
>
Input:
<
input
type=
"text"
placeholder=
"Name"
>
Textarea:
<
textarea
rows=
"4"
placeholder=
"Address"
>
<
/textarea
>
Select:
<
select
>
<
option
>1
<
/option
>
<
option
>2
<
/option
>
<
option
>3
<
/option
>
<
option
>4
<
/option
>
<
/select
>
<
/form
>
嘗試一下 ?
標(biāo)簽
在表單中使用 元素來設(shè)置標(biāo)簽,標(biāo)簽可以添加 for 屬性和 id 屬性。用戶在點(diǎn)擊標(biāo)簽或輸入域時(shí)獲取輸入框焦點(diǎn):
實(shí)例
<
form
>
<
label
for=
"name"
>Input
<
input
type=
"text"
placeholder=
"Name"
id=
"name"
>
<
/label
>
<
label
for=
"adr"
>Label
<
textarea
rows=
"4"
placeholder=
"Address"
id=
"adr"
>
<
/textarea
>
<
/label
>
<
label
for=
"num"
>Select
<
select
id=
"num"
>
<
option
>1
<
/option
>
<
option
>2
<
/option
>
<
option
>3
<
/option
>
<
option
>4
<
/option
>
<
/select
>
<
/label
>
<
/form
>
嘗試一下 ?
如果需要設(shè)置標(biāo)簽右對齊,可以使用 .right 類:
實(shí)例
<
label
class=
"right"
>
嘗試一下 ?
Fieldset
Foundation 渲染 元素的樣式如下:
實(shí)例
<
form
>
<
fieldset
>
<
legend
>Fieldset Legend
<
/legend
>
<
label
>Name
<
input
type=
"text"
placeholder=
"First Name.."
>
<
/label
>
<
label
>Email
<
input
type=
"text"
placeholder=
"Enter email.."
>
<
/label
>
<
/fieldset
>
<
/form
>
嘗試一下 ?
錯(cuò)誤狀態(tài)
使用 .error 類來設(shè)置錯(cuò)誤的標(biāo)簽、輸入框、文本框樣式:
實(shí)例
<
form
>
<
label
class=
"error"
>Error
<
input
type=
"text"
placeholder=
"Name.."
>
<
/label
>
<
small
class=
"error"
>Wrong input
<
/small
>
<
textarea
rows=
"4"
placeholder=
"Address"
>
<
/textarea
>
<
small
class=
"error"
>Wrong input
<
/small
>
<
/form
>
嘗試一下 ?
| 你需要使用 JavaScript 來更新用戶輸入的錯(cuò)誤狀態(tài)。 |
本文標(biāo)題:創(chuàng)新互聯(lián)Foundation教程:Foundation表單
轉(zhuǎn)載來源:http://www.dlmjj.cn/article/ccdheec.html


咨詢
建站咨詢
