Skip to content
Discussion options

You must be logged in to vote

For QImg you need to target the read image
I put the final .q-img__image--loaded so that the rule does not change the placeholder image, but it's not mandatory.
The full chain of selectors is used so that you can put a QImg in another QImg

.q-img.contain > .q-img__container > .q-img__image.q-img__image--loaded {
    object-fit: contain !important;
}

.q-img.cover > .q-img__container > .q-img__image.q-img__image--loaded {
    object-fit: cover !important;
}

https://codepen.io/pdanpdan/pen/GRGWvjR?editors=1100

(fixed wrong codepen link)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@tonjo
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by tonjo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants