UIkit Align– This component allows us to control the alignment of elements. Here in this tutorial, we are going to explain how to align elements in UIkit. You can also use online editor to edit and run the code online.
UIkit Align Text | Image Left | Right | Center Component Example
You can use following classes to align Text/Element/Image in UIkit-
- uk-align-left– This is used to float left with right and bottom margin.
- uk-align-right– This is used to align right with left and bottom margin.
- uk-align-center– This is used to center the element and adds the bottom margin.
Here is an example of alignment classes
UIkit Align Component Example:
<div class="uk-align-left amp-wp-inline-272e4802d02389b174dca822fe9f5b24">Align Left</div> <br/> <div class="uk-align-right amp-wp-inline-272e4802d02389b174dca822fe9f5b24">Align Right</div> <br/> <div class="uk-align-center amp-wp-inline-272e4802d02389b174dca822fe9f5b24">Align Center</div> |
If you run the above example it will produce the output something like this-
Responsive Classes
Following responsive classes are available which will work on Only specific devices.
Class | Description |
---|---|
.uk-align-left@s .uk-align-right@s |
Apply only device of width 640px and higher. |
.uk-align-left@m .uk-align-right@m |
Apply only device of width 960px and higher. |
.uk-align-right@l |
Apply only device of width1200px and higher. |
.uk-align-left@xl .uk-align-right@xl |
Apply only device of width 1600px and higher. |