Tricks with image classes
If you are just starting out with Kirby, please first check out what is possible with Kirbytext image tag https://getkirby.com/docs/reference/text/kirbytags/image.
You can use inbuilt width classes to contain image width. See available classes https://www.one.thezero.club/guide/theme-styling/helpful-classes#width.
Examples:
# The image will take half of parent container
(image: myawesomepicture.jpg class: uk-width-1-2)
# The image will take quoter of parent container
(image: myawesomepicture.jpg class: uk-width-1-4)
Also, a very useful class is the align class, see available here https://www.one.thezero.club/guide/theme-styling/helpful-classes#align.
They are best used when combined with image width classes.
# Half of parent container width, and align right
(image: myawesomepicture.jpg class: uk-width-1-2 uk-align-right)
# Quoter of parent container width, and align center
(image: myawesomepicture.jpg class: uk-width-1-4 uk-align-center)
Your design often needs some control over margin space, and that is when margin classes comes handy https://www.one.thezero.club/guide/theme-styling/helpful-classes#margin.
# Quoter of parent container width, and align center, with bottom margin
(image: myawesomepicture.jpg class: uk-margin-bottom uk-width-1-4 uk-align-center)
The same classes you can add to the Editor image class option.
You can make a negative margin (of -40px) to image with the following classes:
# Negative margin left
(image: myawesomepicture.jpg class: uk-container-item-padding-remove-left)
# Negative margin right
(image: myawesomepicture.jpg class: uk-container-item-padding-remove-right)
Last modified 2yr ago