question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

originalClass applies to surrounding div, not to the img

See original GitHub issue

Hello Xio Lin,

First of all thank you so much for this helpful component. I keep trying to set rounded images (either with the Bootstrap ‘rounded’ or more simply with CSS border-radius: 5px). It does work with thumbnails (by passing this to the thumbnailClass), but not with originals, because originalClass is applied to the div containing the targeted img. Have you an idea how to find a way to apply rounded corners to the originals ? Thanks again !

.myclass (img or not) {
    border-radius: 5px;
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
xiaolincommented, May 12, 2019

Can you show a screenshot? You might also need to apply border-radius: 5px to the parent class image-gallery-slides too.

0reactions
fgaumecommented, May 14, 2019

thanks I had it as well, but the problem came from those 2 additional rules (mandatory in my context) :

.image-gallery-slide img { object-fit: contain; max-height: calc(100vh - 136px); ...

Finally, adding :

width: auto; display:block; margin-left:auto; margin-right:auto;

fixed the problem.

So once more thank you for your help and as a result, this thread was definitely not an issue 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS <img> tag not applying parent div class css style
You need to apply particular styles to the img element itself. For example, if your issue is that a border is appearing on...
Read more >
<div>: The Content Division element - HTML - MDN Web Docs
The <div> HTML element is the generic container for flow content. It has no effect on the content or layout until styled in...
Read more >
The CSS :has Selector (and 4+ Examples)
The CSS :has selector helps you select elements when they contain other elements that match the selector you pass into :has().
Read more >
CSS Tricks: Expanding Beyond a Parent div - Modus Agency
- First set the width of the extended-content-container div to 500%. This will make the div you are trying to extend 5 time...
Read more >
Using :has() as a CSS Parent Selector and much more - WebKit
It turns out, the :has() pseudo-class is not just a “parent selector”. After decades of dead-ends, this selector can do far more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found