Skip to content
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

No rounded borders for top image overlay cards when adding a background to overlay and suggestion for fix #29033

Closed
Michelangelo1984 opened this issue Jul 13, 2019 · 6 comments · Fixed by #30817

Comments

@Michelangelo1984
Copy link

Michelangelo1984 commented Jul 13, 2019

Bootstrap version 4.3.1
Machine Windows 10,
Tested in Firefox (latest) and Chrome (latest)

I found myself having issues with rounded borders when an image is placed as top element in combination with an overlay with background in a card-deck. It does lose it's rounded borders with an overlay with background applied. However I suggest adding a style to the overlay so that the card keeps it's rounded borders for the overlay.

<div class="card">
<img class="card-img-top" src="/assets/images/image.jpg" alt="Card image cap">
<div class="card-img-overlay d-flex justify-content-center">

I added this style to bootstrap CSS file:

.card-img-overlay {
  border-radius: calc(0.25rem - 1px);
}

Codepen that demonstrates the issue when applying a background to the overlay: https://codepen.io/anon/pen/MNyZzg

@Michelangelo1984 Michelangelo1984 changed the title Add rounded borders for image overlay cards No rounded borders for top image overlay cards and suggestion for fix Jul 13, 2019
@coliff
Copy link
Contributor

coliff commented Jul 22, 2019

Bug reports must include a Reduced test case using CodePen or JS Bin. Can you add one?

@Michelangelo1984
Copy link
Author

@coliff Done! Sorry, hadn't the time to properly look into the problem, but the rounded borders break when applying a background to the image overlay class.

@Michelangelo1984 Michelangelo1984 changed the title No rounded borders for top image overlay cards and suggestion for fix No rounded borders for top image overlay cards when combining with a background and suggestion for fix Jul 24, 2019
@Michelangelo1984 Michelangelo1984 changed the title No rounded borders for top image overlay cards when combining with a background and suggestion for fix No rounded borders for top image overlay cards when adding a background to overlay and suggestion for fix Jul 24, 2019
@ysds ysds added the css label Jul 24, 2019
@coliff
Copy link
Contributor

coliff commented Jul 24, 2019

@Michelangelo1984 - an alternative solution would be to simply add the css class rounded like follows:

<div class="card-img-overlay rounded d-flex justify-content-center">

@Michelangelo1984
Copy link
Author

@coliff Thnx, yes that could also be a solution. Didn't know of that class. Still I think that since it is part of the card it should automatically be rounded and not break when adding a background or other css you want to add.

@XhmikosR
Copy link
Member

Does this happen with the latest v4.3.1? The codepen is using 4.1.3.

@Michelangelo1984
Copy link
Author

Michelangelo1984 commented Jul 28, 2019

@XhmikosR It does happen with both versions (tested). So not a new bug, was just unnoticed.

@mdo mdo added this to Inbox in v5 via automation May 14, 2020
@mdo mdo added this to Inbox in v4.5.1 via automation May 14, 2020
mdo added a commit that referenced this issue May 14, 2020
Allows use of background-color and more. Fixes #29033 for v4.
mdo added a commit that referenced this issue May 14, 2020
Allows use of background-color and more. Fixes #29033 for v5.
@mdo mdo added the has-pr label May 14, 2020
v5 automation moved this from Inbox to Shipped May 15, 2020
XhmikosR added a commit that referenced this issue May 15, 2020
Allows use of background-color and more. Fixes #29033 for v5.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
XhmikosR pushed a commit that referenced this issue May 15, 2020
Allows use of background-color and more. Fixes #29033 for v5.
@XhmikosR XhmikosR removed this from Inbox in v4.5.1 May 15, 2020
XhmikosR pushed a commit that referenced this issue May 26, 2020
Allows use of background-color and more. Fixes #29033 for v5.
XhmikosR pushed a commit that referenced this issue May 30, 2020
Allows use of background-color and more. Fixes #29033 for v5.
XhmikosR pushed a commit that referenced this issue Jun 4, 2020
Allows use of background-color and more. Fixes #29033 for v5.
XhmikosR pushed a commit that referenced this issue Jun 4, 2020
Allows use of background-color and more. Fixes #29033 for v5.
olsza pushed a commit to olsza/bootstrap that referenced this issue Oct 3, 2020
Allows use of background-color and more. Fixes twbs#29033 for v5.

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v5
  
Shipped
Development

Successfully merging a pull request may close this issue.

5 participants