Grow your CSS skills. Land your dream job.

CSS Rollover Breaks masonry

  • # January 6, 2013 at 12:57 pm

    As chrisburton [suggested](http://css-tricks.com/forums/discussion/21585/how-do-i-replicate-this-hover-effect#Item_21 “”) here’s the new thread about more complex rollovers.

    I’ve adapted chris [codepen](http://codepen.io/chrisburton/pen/xKLwd “”) example to my project and everything went fine except for links in the rollover. If i put links in the rollover it breaks my masonry layout.

    I made an example (actually another fork of chris snippet) on [Codepen](http://codepen.io/anon/pen/armIo “”)
    The rollover won’t work as long as there’s an a tag somethere inside the rollover.

    it seems it has something to do with nesting links in links but how am i supposed to handle that?

    Many thanks in advance.

    # January 6, 2013 at 1:35 pm

    The problem is that you can’t nest anchor links.

    You may have to use absolute positioning to position the overlay over the image.

    Something like this:





    # January 6, 2013 at 1:42 pm

    but isn’t the overlay already positioned absolutely?

    # January 6, 2013 at 1:45 pm

    Hang on that might not work. Do you have codepen pro?

    # January 6, 2013 at 2:02 pm

    no. I’m more of a casual coder (as one can obviosly see), sorry :(

    # January 6, 2013 at 2:31 pm

    Hmm. I’m not sure how to go about this since you need the whole thing to wrap in an anchor tag (and you can’t nest anchor tags). If I go about it the way I was thinking, the `ul` that wraps around the tags will not be clickable.

    If we go about it the way you’d like, the user could accidentally clicks outside one of the tags and be redirected to wherever the thumbnail links to. Basically it could be annoying to the user.

    # January 6, 2013 at 2:41 pm

    i don’t think there will be too much trouble with usability since the tag links are quite big in size as you can see here [http://tingeltangel.megavillain.org/](http://tingeltangel.megavillain.org/ “http://tingeltangel.megavillain.org/”)

    # January 6, 2013 at 3:34 pm

    What is the browser support requirement?

    # January 6, 2013 at 5:17 pm

    @bogus This is as far as I could go with it: http://codepen.io/chrisburton/pen/jesmr

    Your best solution is probably jQuery.

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

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".