Vstup W3.CSS
Vstupní formulář
Nejlepší štítky
Vstupní formulář
Příklad
<form class="w3-container">
<label>First Name</label>
<input class="w3-input" type="text">
<label>Last Name</label>
<input class="w3-input" type="text">
</form>
Spodní štítky
Vstupní formulář
Příklad
<form class="w3-container">
<input class="w3-input" type="text">
<label>First Name</label>
<input class="w3-input" type="text">
<label>Last
Name</label>
</form>
Vstupní karty
Záhlaví
Příklad
<div class="w3-card-4">
<div class="w3-container
w3-green">
<h2>Header</h2>
</div>
<form class="w3-container">
<label>First Name</label>
<input class="w3-input"
type="text">
<label>Last Name</label>
<input class="w3-input"
type="text">
</form>
</div>
Barevné štítky
K vybarvení štítků použijte kteroukoli z tříd w3-text-color :
Příklad
<form class="w3-container">
<label
class="w3-text-blue"><b>First Name</b></label>
<input class="w3-input w3-border" type="text">
<label
class="w3-text-blue"><b>Last Name</b></label>
<input class="w3-input w3-border" type="text">
<button class="w3-btn
w3-blue">Register</button>
</form>
Ohraničený vstup
Přidejte třídu w3-border a vytvořte ohraničené vstupy:
Příklad
<input class="w3-input w3-border"
type="text">
Zaoblené hranice
K vytvoření zaoblených hranic použijte kteroukoli z tříd w3-round :
Příklad
<input class="w3-input w3-border w3-round"
type="text">
<input class="w3-input w3-border
w3-round-large"
type="text">
Bezokrajový vstup
Třída w3-input má ve výchozím nastavení spodní okraj. Pokud chcete vstup bez okrajů, přidejte třídu w3-border-0 :
Příklad
<form class="w3-container w3-light-grey">
<label>First
Name</label>
<input class="w3-input w3-border-0" type="text">
<label>Last Name</label>
<input class="w3-input
w3-border-0" type="text">
</form>
Barvy
Neváhejte použít své oblíbené styly a barvy:
Vstupní formulář
Příklad
<div class="w3-container w3-teal">
<h2>Input Form</h2>
</div>
<form class="w3-container">
<label class="w3-text-teal"><b>First Name</b></label>
<input class="w3-input w3-border w3-light-grey" type="text">
<label class="w3-text-teal"><b>Last Name</b></label>
<input class="w3-input w3-border w3-light-grey" type="text">
<button class="w3-btn w3-blue-grey">Register</button>
</form>
Pohyblivé vstupy
Třídy barev w3-hover- přidávají barvu pozadí do vstupního pole při přejetí myší:
Příklad
<input class="w3-input w3-hover-green" type="text">
<input class="w3-input
w3-border w3-hover-red" type="text">
<input class="w3-input
w3-border w3-hover-blue" type="text">
Animované vstupy
Třída w3-animate-input transformuje šířku vstupního pole na 100 %, když je aktivní:
Příklad
<input class="w3-input w3-animate-input"
type="text" style="width:30%">
Příklad
<input class="w3-check" type="checkbox" checked="checked">
<label>Milk</label>
<input class="w3-check"
type="checkbox">
<label>Sugar</label>
<input class="w3-check" type="checkbox" disabled>
<label>Lemon (Disabled)</label>
Příklad
<input class="w3-radio" type="radio" name="gender" value="male" checked>
<label>Male</label>
<input class="w3-radio"
type="radio" name="gender" value="female">
<label>Female</label>
<input class="w3-radio"
type="radio" name="gender" value="" disabled>
<label>Don't know (Disabled)</label>
Vyberte Možnosti
Příklad
<select class="w3-select" name="option">
<option value="" disabled
selected>Choose your option</option>
<option value="1">Option
1</option>
<option value="2">Option 2</option>
<option
value="3">Option 3</option>
</select>
Bordered Select Menu
Příklad
<select class="w3-select w3-border" name="option">
Prvky formuláře v mřížce
V tomto příkladu používáme Responsive Grid System W3.CSS, aby se vstupy objevily na stejném řádku (na menších obrazovkách se budou skládat vodorovně se 100% šířkou). Více se o tom dozvíte později.
Příklad
<div class="w3-row-padding">
<div class="w3-third">
<input class="w3-input w3-border" type="text" placeholder="One">
</div>
<div class="w3-third">
<input
class="w3-input w3-border" type="text" placeholder="Two">
</div>
<div class="w3-third">
<input class="w3-input
w3-border" type="text" placeholder="Three">
</div>
</div>
Mřížka s popisky
Příklad
<div class="w3-row-padding">
<div class="w3-half">
<label>First Name</label>
<input
class="w3-input w3-border" type="text" placeholder="Two">
</div>
<div class="w3-half">
<label>Last
Name</label>
<input class="w3-input
w3-border" type="text" placeholder="Three">
</div>
</div>