Grow your CSS skills. Land your dream job.

Text popup in another div?

  • # June 6, 2013 at 4:39 pm

    Hi everyone. How can I mouse over a link in one div and make the text pop up in another div?

    Right now I have the HTML for my links kind of like this:

    -and the CSS specifying that the link should pop up in a certain location -

    div#links a: hover span {
    display: block;
    position: absolute;
    top: 530px;
    left: 680px;
    /* etc., etc. */
    }

    …but the position is absolute, and I don’t want this. I want the text to pop up inside the next div – div#whereIwantthetexttopopup. What do I do? I’ve got the next div all ready to go, it’s floating left, so it’s the very next one over on the right, all I need to do is get my text to pop up in there.

    I’m sure this is easy – I just don’t know very much CSS, which is probably obvious. Any and all help appreciated!

    [Mod Edit] Cleaned up the code for you. Feel free to browse the [Markdown resources](http://daringfireball.net/projects/markdown/syntax “”) to learn more about how to format your text/code properly.

    # June 6, 2013 at 5:03 pm

    Not that easy really..generally content such as this span will appear where it’s supposed to be.

    We can move it visually with CSS but we can’t transplant it from one div to another.

    You can do things with pseudo elements like tooltips and pop-ups but it sounds to me as though you’re moving actually content about and for that you’ll need javascript.

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

You must be logged in to reply to this topic.

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