Control the alignment of inline elements depending on the viewport size.
Usage
To align images or other elements with spacing between the text and the element, add one of these classes.
Class | Description |
---|---|
.gls-align-left |
Floats the element to the left and creates right and bottom margin. |
.gls-align-right |
Floats the element to the right and creates left and bottom margin. |
.gls-align-center |
Centers the element and creates bottom margin. |
<img class="gls-align-left" src="" width="" height="" alt="">
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<div class="gls-panel"> <img class="gls-align-left gls-margin-remove-adjacent" src="https://utahhealthcare.github.io/gloss-docs/images/light.jpg" width="225" height="150" alt="Example image"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div>
Responsive
Gloss provides a number of responsive alignment classes. Basically, they work just like the usual alignment classes, except that they have suffixes that represent the breakpoint from which they come to effect.
Class | Description |
---|---|
.gls-align-left@s .gls-align-right@s |
Only affects device widths of 640px and higher. |
.gls-align-left@m .gls-align-right@m |
Only affects device widths of 960px and higher. |
.gls-align-left@l .gls-align-right@l |
Only affects device widths of 1200px and higher. |
.gls-align-left@xl .gls-align-right@xl |
Only affects device widths of 1600px and higher. |
<img class="gls-align-center gls-align-right@m" src="" width="" height="" alt="">
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<div class="gls-panel"> <img class="gls-align-center gls-align-right@m gls-margin-remove-adjacent" src="https://utahhealthcare.github.io/gloss-docs/images/light.jpg" width="225" height="150" alt="Example image"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> <p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div>