The Foundation form control is automatically set to the global style:
所有 , 及 元素宽度都为 100%,且带有外边距、内边距、阴影和鼠标移动效果。
8.23.1. Example ¶
<form>
Input:
<input type="text" placeholder="Name">
Textarea:
<textarea rows="4" placeholder="Address">textarea>
Select:
<select>
<option>1option>
<option>2option>
<option>3option>
<option>4option>
select>
form>
Label ¶
Use in a form Element to set the tag, which can add a for attribute and an id attribute. The user gets the focus of the input box when clicking on the label or input field:
8.23.2. Example ¶
<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>1option>
<option>2option>
<option>3option>
<option>4option>
select>
label>
form>
If you need to set the right alignment of labels, you can use the .right Class:
8.23.3. Example ¶
<label class="right">
8.23.4. Fieldset ¶
Foundation 渲染 ``8.23.5. Example ¶
<form>
<fieldset>
<legend>Fieldset Legendlegend>
<label>Name
<input type="text" placeholder="First Name..">
label>
<label>Email
<input type="text" placeholder="Enter email..">
label>
fieldset>
form>
Error statu ¶
Use .error Class to set the wrong label, input box, and text box style
8.23.6. Example ¶
<form>
<label class="error">Error
<input type="text" placeholder="Name..">
label>
<small class="error">Wrong inputsmall>
<textarea rows="4" placeholder="Address">textarea>
<small class="error">Wrong inputsmall>
form>
注意 You need to use JavaScript to update the error status entered by the user.