PDA

View Full Version : z-index and url links


Cherubae
03-23-2003, 07:22 AM
I am having a problem getting an href link to sit on top of an image. It's probably something I'm just overlooking being it's so late at night but I'm not going to get much sleep unless I can get it resolved ;)

http://www.fogu.com/hm4/test.php <- page url, 1024x768+ version only one working currently, sorry

I have a tree trunk set above a div along the far left hand side. The tree trunk has a z-index of 10. To the right I have my navigation area. The divs all have a z-index of 2 so the background image of the right-of-tree div sits behind the tree trunk. The problem is if I had a href link in the right hand div, the tree trunk picture covers up half of the link, resulting in the link only working if you mouseover the right-half of the link. I'm kind of hoping to get the whole thing working instead of just half of the link :D

I've tried to add a z-index of 12 in the link style itself but that hasn't worked. I also switched the right-of-tree div to be on the 12th layer, but then the tree trunk picture is behind the div whereas I would like it in front. I tried making another div with the z-index of 12 where the links would sit inside of, but that didn't do much good either.

Any ideas?

redhead
03-23-2003, 10:01 AM
well... this might be the problem.. or it might not be - take a look at lines 56 + 57:

<div id="mainDivUpArrows" class="absDiv" style="z-index:3;>
<a href="javascript:void(0)" onMouseDown="mainDiv.setScroll(-10, 8); return false"

in that div you havnt closed the style attribute, so the browser doesnt know youve even put the link there... and the same goes for lines 70+71... remember you must close a value if youve opened it, and you must open it in XHTML, therefore you must close it! ;)

does that help? :thumbsup:

[edit] i suggest you download a text editor with syntax highlighting, it makes these problems easy to spot :)

Cherubae
03-23-2003, 05:47 PM
Thanks, but adding the two missing quotation mark didn't do anything to solve my problem :o

Cherubae
03-24-2003, 03:33 PM
After a good sleep I solved my problem :eek: I was trying to push the "navigation" area onto layer 12 while being nested inside a div that was set on layer 2. Once I put the "navigation" outside of the div layouts, the z-indexing worked just fine :thumbsup: Now the links work on layer 12 without being covered up by the tree trunk image.