Form Layout
Give your forms some structure—from inline to horizontal to custom grid implementations.
Forms
Every group of form fields should reside in a <form>
element. Astral provides no default styling for the <form>
element, but there are some powerful browser features that are provided by default.
- New to browser forms? You may consider reviewing the MDN form docs for an overview and complete list of available attributes.
<button>
s within a<form>
default totype="submit"
, so strive to be specific and always include atype
.- You can disable every form element within a form with the
disabled
attribute on the<form>
.
Form Grid
More complex forms can be built using our grid classes. Use these for form layouts that require multiple columns, varied widths, and additional alignment options.
More complex layouts can also be created with the grid system.
Horizontal Forms
Create horizontal forms with the grid by adding the .columns
class to form groups and using the .col-*
classes to specify the width of your labels and form inputs.
Column Spacing
As shown in the previous examples, our grid system allows you to place any number of .column
s within a .columns
. They’ll split the available width equally between them. You may also pick a subset of your columns to take up more or less space, while the remaining .column
s equally split the rest, with specific column classes like .column.col-7
. or .column.col-md-7.
Form inline
AiraCSS also supports inline forms without using flex utilities.Just use the class form-inline
.