Image is not visible if its parent is styled as `overflow: hidden`
See original GitHub issueIf the parent of the image is styled as overflow: hidden
, the image will not be visible. Needs to find a way to ignore overflow: hidden
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
center image inside overflow-hidden-parent - css
Save this question. Show activity on this post. I have an image inside a span tag, the span has a set width and...
Read more >overflow - CSS-Tricks
The overflow property controls what happens to content that breaks outside of its bounds: imagine a div in which you've explicitly set to...
Read more >overflow - CSS: Cascading Style Sheets - MDN Web Docs
visible. Content is not clipped and may be rendered outside the padding box. hidden. Content is clipped if necessary to fit the padding...
Read more >Only hide CSS overflow on a single x or y axis, or ignore it
The solution is simple, if not a little bit hacky. Wrap the container in another div. <style> .wrapper { height: 50px; width: 50px;...
Read more >How to prevent overflow scrolling in CSS - LogRocket Blog
With the auto value, the content that is not visible in the viewport is hidden, and scroll bars are introduced so the expanded...
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
@kingdido999 I’m not sure
onBeforeOpen
andonClose
events are mentioned in the doc, I didn’t see them.Anyway, they could help with this problem, so here is my idea:
HTML
JS
CSS
I didn’t test this solution for know…
Cheers
@jimblue This solution looks interesting. But as you said, the documentation on the event seems lacking.
Do the events pass anything to the handler function? In my case, I have
overflow: hidden
on the immediate parent around the image. I have<a><img /></a>
, whereoverflow: hidden
is on the<a>
tag. If the event handler has access to theimg
element, then I could just remove the overflow style on the parenta
element. Can anyone help with this?