Treehouse: Grow your CSS skills. Land your dream job.

Link and img with an :after

  • # March 27, 2013 at 1:43 pm

    Hello all,

    I have created and img with an :after attribute. The :after is actually positioned absolute and covers the whole image with a higher z-index than the image. In the HTML I sandwitched the img with an anchor link but I can’t click the link in the browser because the :after is covering the whole img and has a higher z-index. Is there a way around this without too big of a change in the CSS and HTML? I don’t really want to get rid of the :after attribute.

    Thanks again.

    # March 27, 2013 at 2:33 pm

    Could you make a CodePen so we can play around your code please?

    # March 27, 2013 at 2:59 pm

    I think `pointer-events: none;` on your pseudo-element should do the trick.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.