Hi, everyone! Does anyone know the CSS code that “trims” PNG images to their edges so they don’t overlap with what’s underneath them? I don’t know how to explain it! Let’s say I place some text and a PNG image next to it, and it won’t let me select the text underneath the image even though the image has a transparent background. There’s a CSS code that prevents that from happening! But I forgot it. <|3
like others are saying, z-index or pointer-events. pointer-events: none; will no longer allow the image to be clicked, and z-index sets the order of the elements, so the text could be 2 and the image 1, the text will be on top of the image. also, if the image is added after the text in html u will always have this problem without intervention
Hi, everyone! Does anyone know the CSS code that “trims” PNG images to their edges so they don’t overlap with what’s underneath them? I don’t know how to explain it! Let’s say I place some text and a PNG image next to it, and it won’t let me select the text underneath the image even though the image has a transparent background. There’s a CSS code that prevents that from happening! But I forgot it. <|3
if im understanding right, maybe clip-path could work?
z-index?
pointer-events: none disables mouse interaction if you don’t want the image to be selectable/block stuff
like others are saying, z-index or pointer-events. pointer-events: none; will no longer allow the image to be clicked, and z-index sets the order of the elements, so the text could be 2 and the image 1, the text will be on top of the image. also, if the image is added after the text in html u will always have this problem without intervention