Forum Moderators: not2easy

Message Too Old, No Replies

positioning issue

absolute vs. relative?

         

victoryrun

7:45 pm on Nov 10, 2005 (gmt 0)

10+ Year Member



I am creating a sort of tooltip info box that pops up when clicked for a client and have just about got it except for the position problem. If I set the position to absolute, then all the boxes are X pixels from the top of the browser. I want them to be X pixels from the actual link, but when I set the position to relative, it then brings up the box inside the rest of the text as opposed to on "top" of it. How do I accomplish this?

Thanks!

xfinx

8:37 am on Nov 12, 2005 (gmt 0)

10+ Year Member



Well you have to know on what position the person clicked.. that is not possible in css.

I think you'll get a combination of javascript and css

LBmtb

9:23 am on Nov 12, 2005 (gmt 0)

10+ Year Member



Do this to the link style . . .

display: block
position: relative

Now the tooltip which is absolute positioned will consider it's container to be the link instead of the html document.

Not sure if you need to set it to block, somebody else can correct me on that. Kind of late and tired to look that up.

xfinx

9:31 am on Nov 12, 2005 (gmt 0)

10+ Year Member



where was I with my head..
indeed what you said is a nice solution.
But I don't know what IE does with it as it might stretch the link.
as far as I know you don't need block.