UIkit Align


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-

  1. uk-align-left– This is used to float left with right and bottom margin.
  2. uk-align-right– This is used to align right with left and bottom margin.
  3. 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 style="width:100px;background:yellow;" class="uk-align-left">Align Left</div>
<br>
<div style="width:100px;background:yellow;" class="uk-align-right">Align Right</div>
<br>
<div style="width:100px;background:yellow;" class="uk-align-center">Align Center</div>

Try it »

If you run the above example it will produce the output something like this-

UIkit Align Example

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-left@l
.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.

Advertisements

Add Comment

📖 Read More