ARTICLE AD BOX
So im designing an element/code in js and html that makes it so when you hover over a class called "img_container_invis" it makes a comment icon appear, but even though everything should be set correctly, the comment icon activates when you hover over a class called "picture_batch_container" which holds img_container_invis. I've tried moving around divs and imgs, re-assigning ids and data-comments, nothing seems to work.
Restating, the issue is when the mouse enters Picture_batch_container the comment icon appears, instead of the comment icon when the mouse enters img_container_invis.
heres a snippet.
13.1k5 gold badges14 silver badges28 bronze badges
4
the parent element uses grid layout, which is breaking inline-block.
img_container_invis is not shrinking to contain its contents, its expanding to fill its parent container.
Not sure this is the best solution, but you can apply height: fit-content; and width: fit-content; to img_container_invis.
your problem is css rather than javascript, do you specifically need to use javascript? you could achieve the same result with plain css
5,2304 gold badges25 silver badges41 bronze badges
your div img_container_invis is as big as the picture_batch_container_img that causes that beaviour.
It's a css problem. Set the div 300x300 and fit the image inside it.
New contributor
LeonardoP is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Explore related questions
See similar questions with these tags.
