Below I have an image followed by text. How do I prevent the area surrounding it from being highlighted? The image itself is not selectable (using
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
pointer-events: none;
) but the surrounding area of the image is. I tried adding left and right margins to the image as well as making the image its own div and applying the above code to the div, but it does not work. (I made the highlight green)
Edit: Here is another example linked here https://jsfiddle.net/nnzf4h5c/