Decoration Utilities
Image Utilities
A few image manipulation classes.
Cover images
.img-cover
– this class sets the image to expand (or contract) to the full width and height of its wrapping block, without distortion.
You will need to narrow and widen your browser window to see the effect of this utility class.
<img class="img-cover" src="">
Notes:
- This utility class works on the
<img>
tag. It does not work very well on an embedded<svg>
. But it works fine on an SVG image inserted into a page the normal way for images:<img src="filename.svg">
. - Your image will need to be approximately a square. Also, ensure that the most important part of your image is in the center and middle – otherwise it may get “cropped” when viewed on some device sizes (or browser widths).
Grayscale filter
<img class="img-grayscale" src="">
Blur filter
<img class="img-blur" src="">
Don’t like the blurry edges spreading outside of the image rectangle? Then wrap the image in a block that has the .overflow-hidden
utility class.
<div class="overflow-hidden">
<img class="img-blur" src="">
</div>