I have a div nested in a td and the div class is set to absolute:
.mouseover-tooltip {
width:400px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border:1px solid #555;
background-color:#FFFFFF;
-webkit-box-shadow: #B3B3B3 9px 9px 9px;
-moz-box-shadow: #B3B3B3 9px 9px 9px;
box-shadow: #B3B3B3 9px 9px 9px;
position:absolute;
z-index:10;
left:-9999px;
padding:5px;
display: none;
}
But when I give it a top of 0, it aligns itself with the top of it’s parent. That’s not what I want. I want to work in an absolute world.
That’s how absolute positioning works: relative to the offset parent.1 From your statement I can infer that the element’s parent is positioned.2
Use
.offset()to set the position of the element relative to the document, or change the HTML structure such that the element’s offset parent is the<body>.1. The closest positioned ancestor or the containing block.
2. That is, the parent has computed
positionofrelative,absolute, orfixed.