Skip to content

Stop oversized images in .card-img-* from overflowing the card's boundaries #18914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

simeon
Copy link

@simeon simeon commented Jan 16, 2016

Images in cards using card-img-top or card-img-bottom via src="" (instead of data-src="") would overflow past the bounds of the card if the image width was too large. Now they will at most be equal to the width of the card.

Simeon Videnov added 2 commits January 15, 2016 20:58
Images in cards using card-img-top or card-img-bottom via src (instead of data-src) would overflow past the bounds of the card if the image width was too large.  Now they will at most be equal to the width of the card.
Fixed issue with non data-src images in card-img
@cvrebert cvrebert changed the title Fixed issue with non data-src images in card-img Fixed issue with oversized images in card-img Jan 16, 2016
@cvrebert
Copy link
Collaborator

FYI, data-src is a Holder.js-ism. The fact that data-src was ever shown in the docs code snippets was a bug (#18558).
So you're really just talking about oversized images in general.

@cvrebert
Copy link
Collaborator

Seems like it might be better to @include img-fluid instead, but I'm not too familiar with the Cards code.

@cvrebert cvrebert changed the title Fixed issue with oversized images in card-img Stop oversized images in .card-img-* from overflowing the card's boundaries Jan 16, 2016
Originally was "width: 100%;", rewrote to utilize the existing @include for responsive images
@simeon
Copy link
Author

simeon commented Jan 16, 2016

@cvrebert I looked into it and you're right. Using @include img-fluid(block); would do the same job with a better "grammer". I've updated my commit to reflect that.

@cvrebert
Copy link
Collaborator

Have you tested this out when Flexbox is enabled ($enable-flex: true;)?

@simeon
Copy link
Author

simeon commented Jan 16, 2016

@cvrebert Yup, I just recompiled with Flexbox enabled and it's all good.

@cvrebert cvrebert added this to the v4.0.0-alpha.3 milestone Jan 16, 2016
@cvrebert
Copy link
Collaborator

CC: @mdo for final review

@mkroeders
Copy link
Contributor

Have this issue also, so to counter it I did an .img-fluid on the img, <img class="card-img-top img-fluid" src="..."/>. Which did not solve it for me, a width: 100% was needed for me.

I checked when you use $enable-flex: true; the width: 100% is needed otherwise the .img-fluid is enough.

@mdo mdo modified the milestones: v4.0.0-alpha.3, v4.0.0-alpha.4 May 8, 2016
@mdo
Copy link
Member

mdo commented Sep 12, 2016

This was addressed with the use of utilities in #20667, but I didn't check out the flex variation. If that's still a problem, can one of y'all open an issue with a test case that confirms that behavior? <3

@mdo mdo closed this Sep 12, 2016
@mdo mdo removed this from the v4.0.0-alpha.5 milestone Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants