Depending on the type of element you are styling, you can apply different types of positioning to them.
Some of the examples shown below have some abstract implications. If you are unfamiliar with the more intricate points of CSS,
feel free to ask your friendly resident front-end developer for advice. Just be sure to bring chocolate.
These classes will make elements be handled as if they were block, inline-block, or inline elements.
Alignment – Horizontal
These classes go on the parent container of the elements you want to align. You can align any inline content,
such as text, images, block elements displayed as inline-block, etc.
Alignment – Vertical
You can vertically align elements with these classes. Usage will differ depending on the element you use them on.
For inline elements (including inline-block), it will vertically align the element with
its sibling inline elements.
For table cells, it will vertically align the content of the cell.
Vertically aligned table content
<table>
<tbody>
<tr>
<th class="one-half align-middle">
This table cell is aligned "middle".
</th>
<th class="one-half">
This is non-aligned text that is really
just here to make one table cell larger
than the other so you can see the
effect on the other side.
</th>
</tr>
</tbody>
</table>
This table cell is aligned "middle".
This is non-aligned text that is really
just here to make one table cell larger
than the other so you can see the
effect on the other side.
Floats
If you want to make your elements float, you can use the classes float-left and float-right
To reset an existing float state of an element, you can use the float-none class.
Clearing Floats
You can clear floating elements on either side using the classes clear-left, clear-right
or clear-both.
Hiding Elements
You can hide elements from the document to hide content that is currently unavailable or unimportant,
to spare the user content that is not meant for human readers, to adjust your layout, etc.
The hide class will (visually) remove the element from the document and make the rest of the
document flow as it if weren't there.
Hiding Elements from Specific States
Since this is a very useful tool to improve the user experience for different devices, you can also hide elements
based on the state that the user is in.
To make an element disappear from specific states, add one or more of the usual state prefixes palm-,
lap- or desk-.
Temporarily Invisible Elements
Sometimes, you may want to temporarily hide an inactive part of the interface, but keep a blank area
in its place to maintain the page layout. For such cases, you can use the invisible class.
Miscellaneous
This section covers styling methods that are either self-explanatory, or so specific that explaining them in
detail should not be part of this documentation.
Examples in this section will offer no further explanation – please refer to your colleagues in front-end
development should you have any questions.