Pure.CSS - Formas
Pure.CSS tiene un CSS muy hermoso y receptivo para diseños de formularios. Se utilizan los siguientes CSS:
No Señor. | Nombre y descripción de la clase |
---|---|
1 | pure-form Representa un formulario en línea compacto. |
2 | pure-form-stacked Representa un formulario apilado con elementos de entrada debajo de las etiquetas. Para usar con forma pura. |
3 | pure-form-aligned Representa un formulario alineado con elementos de entrada debajo de las etiquetas. Para usar con forma pura. |
4 | pure-input-rounded Muestra un control de formulario con esquinas redondeadas |
5 | pure-button Embellece un botón. |
6 | pure-checkbox Embellece una casilla de verificación. |
7 | pure-radio Embellece una radio. |
Ejemplo
purecss_forms.htm
<html>
<head>
<title>The PURE.CSS Forms</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://yui.yahooapis.com/pure/0.6.0/pure-min.css">
</head>
<body>
<form class = "pure-form pure-form-aligned">
<fieldset>
<div class = "pure-control-group">
<label for = "name">Username</label>
<input id = "name" type = "text" placeholder = "Username" required>
</div>
<div class = "pure-control-group">
<label for = "email">Email</label>
<input id = "email" type = "text" placeholder = "Email Address" required>
</div>
<div class = "pure-control-group">
<label for = "comments">Comments</label>
<input id = "comments" type="text" placeholder = "Comments">
</div>
<div class = "pure-controls">
<label for = "married" class = "pure-checkbox">
<input id = "married" type = "checkbox" checked = "checked">
Married
</label>
<br>
<label for = "single" class = "pure-checkbox">
<input id = "single" type = "checkbox">
Single
</label>
<br>
<label for = "dontknow" class = "pure-checkbox">
<input id = "dontknow" type = "checkbox" disabled>
Don't know (Disabled)
</label>
<br>
<br>
</div>
<div class = "pure-controls">
<label for = "male" class = "pure-radio">
<input id = "male" type = "radio" name = "gender" value = "male" checked>
Male
</label>
<br>
<label for = "female" class= "pure-radio">
<input id = "female" type = "radio" name = "gender" value = "female">
Female
</label>
<br>
<label for = "dontknow1" class = "pure-radio">
<input id = "dontknow1" type = "radio" name = "gender" value = "female" disabled>
Don't know (Disabled)
</label>
<button type = "submit" class = "pure-button pure-button-primary">Submit</button>
</div>
</fieldset>
</form>
</body>
</html>
Resultado
Verifica el resultado.