View Full Version : Css popup pickle??

10-02-2004, 01:49 PM
Ok....here is my goal. On my website im trying to use a z-index layer as a popup for my photo viewer. This photo viewer will have links, an iframe, possibly a table. Now here is what i got and it kind of works.

.ratmilk {
display: block;
left: -999em;
position: absolute;
width: 90%;
height: 95%;
top: 0;
background: #c0c0c0;
z-index: 2;

.ratmilk:focus, a.ratmilk:hover {
left: 5%;

Here is my Html

<a href="#dumbmonkeyface">Photo album</a>
<a class="ratmilk" name="dumbmonkeyface">content goes here</a>

Now like i said ive got this to work but when i try to change the anchor to a paragraph type dag or even a div....it wont work. It does not work very well to put my content in this anchor. I also have no idea what to do for the link to close this picture viewer popup layer. I'm new to css and ive been reading and learning from sons of suckerfish dropdown menus and such.
Any help is appreciated.


10-02-2004, 02:02 PM
For an anchor to work, the target must be on a <a> tag, eg.
<a name="foo"></a>

10-02-2004, 02:32 PM
the id attribute also works.

<a href="#foo">link here</a><p id="foo">content</p>

10-02-2004, 04:57 PM
never mind i figured it out with the :target pseudo and some javascript.