Last active
April 27, 2022 09:04
-
-
Save dannyfoo/740faea65ed649c1a0c6ddede4eb310f to your computer and use it in GitHub Desktop.
Elementor snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Force the feature image to occupy post image space in Cards layout | |
* Choose 1 of the solutions below which suits your scenario | |
**/ | |
/* if the elementor-fit-height class exists */ | |
.elementor-post__thumbnail.elementor-fit-height img { | |
height: 100% !important; | |
width: auto !important; | |
} | |
/* target all the elementor-post__thumbnail class */ | |
.elementor-post__thumbnail.elementor-fit-height img { | |
height: 100% !important; | |
object-fit: cover; | |
} | |
/** | |
* Force the images in carousel to fit based on available width regardless of their height | |
* This is when image size uses default sizes (e.g. Large, Medium etc) | |
**/ | |
.elementor-image-carousel .swiper-slide { | |
height: auto; /* makes the container use the image height as a reference */ | |
} | |
.elementor-image-carousel .swiper-slide figure, | |
.elementor-image-carousel .swiper-slide img { | |
height: 100%; /* forces the figure and img to fill the height of the container */ | |
object-fit: cover; /* forces the img to fill based on the container height */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment