Skip to content

Images in card columns do not scale well #20560

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
mrkkrp opened this issue Aug 22, 2016 · 3 comments
Closed

Images in card columns do not scale well #20560

mrkkrp opened this issue Aug 22, 2016 · 3 comments
Labels

Comments

@mrkkrp
Copy link

mrkkrp commented Aug 22, 2016

When using card-columns with images, the images do not seem to scale well. Here I attach a complete reproducing example which you can just open in your browser and see.

bad-cards.txt

(Change extension from txt to html because GitHub wouldn't allow me to put HTML doc here.)

The example is composed as per your v4 docs, as combination of the “starter example” and the example code for the card-columns feature. For image placeholders I used https://placehold.it service.

I checked with Firefox and Chromum, and got the same results:

image-scaling-0
image-scaling-1
image-scalling-2
ugly-corner

With every zoom value imaginable images look wrong. (Also note the ugly corner.)

Maybe I don't understand something and the images are not supposed to scale and look well?

@mdo mdo added the css label Aug 23, 2016
@thomashare
Copy link

Yes, card images should take in the img-fluid class settings.

@mdo
Copy link
Member

mdo commented Sep 7, 2016

I'll take a look at this a bit more, but you can fix it by adding .img-fluid to the .card-img-* elements. I'll likely update the docs to include those classes rather than mixin/extend the class into the .card- component itself (to avoid duplication of code).

As for the corner, that's a rounding problem on our part. We need to subtract the 1px border from the border-radius: .25rem, which means pulling out calc.

All doable and fixable, but wanted to explain the problem ahead of me opening a PR to fix :).

@mdo mdo added this to the v4.0.0-alpha.5 milestone Sep 7, 2016
@mdo mdo closed this as completed in #20667 Sep 8, 2016
@mrkkrp
Copy link
Author

mrkkrp commented Sep 8, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants