Search code examples
csshtmlcommentspositioning

Div Positioning follows the other div


Having a little problem with the comment part on the website i'm working on:

http://whybaguio.com/php/profile/businessprofile.php?id=103#

See how the ADD YOUR OWN FEEDBACK! div goes down together with the Facebook comment. I don't know how to not let it go down with the facebook comments.... Lol, I'm not really sure if I'm explaining my self right but I hope you guys get it...

I tried positioning it relative and absolute but it goes out of its parent div....

Please help me out, thank you!


Solution

  • Okay, this is a problem with how to use position:absolute; What you need to do is change your code like this:

    #feed {
    background: white;
    height: 280px;
    padding: 10px;
    margin-top: 295px;
    overflow-y: auto;
    margin-left: -580px;
    position: relative;/*this needs to have a position for .secondcomment to 'hook on' to*/
    }
    
    .secondcomment {
    position: absolute;
    top: 10px;
    right: 0;
    }