I am trying to position a dialog box right under a + (plus) sign.
This is the code I am using:
<div class="container"><div class="projectsContainer">
<div class="sectionTitle">Projects</div>
<div class="project-items">
<div class="project-item">
<div class="projectTitle"><a href="#">Product Management Tool</a></div>
<div class="projectDetails">
<div class="projectCompletion">
<div class="projectProgressed"></div>
</div>
<div class="projectMore"><img src="/images/add_button_shadow_blue.png">
<div class="dialogContainer dialogEditProject"><div class="dialog editProjectDialog"><ul><li id="editProject">Edit</li><li id="removeProject">Remove</li></ul></div></div>
</div>
</div>
<div class="clearBoth"></div>
<div class="projectDescription">
No description </div>
</div>
</div>
</div></div>
In .projectMore is .dialogEditProject that is absolute positioned. When I load the page in the browser is looks like it is not absolute positioned to it.
Here is the code, to see the behavior live: jsfiddle
Give this CSS to
.projectMore:Explanation
When you give an element
relativeposition, it becomes the boundary of theabsolutepositioned elements, so that you can usetop,left,right,bottomon theabsolutepositioned element with respect to the relatively positioned parent. 🙂