originalClass applies to surrounding div, not to the img
See original GitHub issueHello 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:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you show a screenshot? You might also need to apply
border-radius: 5px
to the parent classimage-gallery-slides
too.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 😉