# Foundation 表單
Foundation 表單控制會自動設置為全局樣式:
所有 `<textarea>`, `<select>` 及 `<input>` 元素寬度都為 100%,且帶有外邊距、內邊距、陰影喝鼠標移動效果。
### 實例
```
<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>
```
## 標簽
在表單中使用 `<label>` 元素來設置標簽,標簽可以添加 for 屬性和 id 屬性。用戶在點擊標簽或輸入域時獲取輸入框焦點:
### 實例
```
<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>
```
如果需要設置標簽右對齊,可以使用 `.right` 類:
### 實例
```
<label class="right">
```
## Fieldset
Foundation 渲染 `<fieldset>` 元素的樣式如下:
### 實例
```
<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>
```
## 錯誤狀態
使用 `.error` 類來設置錯誤的標簽、輸入框、文本框樣式:
### 實例
```
<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 來更新用戶輸入的錯誤狀態。
- Foundation 入門
- Foundation 5 簡介
- Foundation 起步
- Foundation 文本
- Foundation 表格
- Foundation 按鈕
- Foundation 按鈕組
- Foundation 圖標
- Foundation 標簽
- Foundation 提醒框
- Foundation 進度條
- Foundation 面板
- Foundation 圖片
- Foundation 下拉菜單
- Foundation 折疊列表
- Foundation 列表
- Foundation 選項卡
- Foundation 分頁
- Foundation 價格表
- Foundation 頂部導航欄
- Foundation 側邊欄
- Foundation 滑動導航(Off-Canvas)
- Foundation 麥哲倫(Magellan)導航
- Foundation 表單
- Foundation 輸入框尺寸
- Foundation 開關
- Foundation 滑塊
- Foundation 提示框
- Foundation 模態框
- Foundation Joyride
- Foundation 均衡器(Equalizer)
- Foundation 網格
- Foundation 網格系統
- Foundation 網格 - 水平堆疊
- Foundation 網格 - 小型設備
- Foundation 網格 - 中型設備
- Foundation 網格 - 大型設備
- Foundation 塊狀網格
- Foundation 網格實例
- Foundation 參考手冊
- Foundation 圖標參考手冊
- Foundation CSS 參考手冊
- Foundation CSS 可見性