Forum Moderators: not2easy
<DIV STYLE = "position: absolute; left: 0; top:0">
<img src = "indeximages/logo.jpg" Alt = "Our name">
</DIV>
<DIV STYLE = "position: absolute; left: 48; top:110">
<a STYLE = "text-decoration:none" href = "index.html"><p>home</p></a>
</DIV>
The "home" link is superimposed on top of the logo. If I move it off of the logo, the link works. On top of the logo, it doesn't work at all. I am testing on IE 5.0
Thanks
Gus
You can't set an entire paragraph to be a link.
<p> is a block tag and <a> is an inline tag - inline tags can appear inside blocks but not vice versa.
You could just change it to be:
<p><a style="text-decoration:none" href="index.html">home</a></p> Make a friend of the w3c HTML Validator [validator.w3.org] - it will help you pick up little mistakes like this.
I would suggest setting the div (or <p> ) with the link in it to have a higher z:index than the div you are trying to super-impose it on..
with absolute positioning the div is already as wide/high as you want it to be all you actually want it to do is appear over/"on top of" an image (background or not) so just make it "appear" higher in the stacking order that should seal it, no matter where it is the HTML source code...
<div style = "position: absolute; left: 48; top:110; z-index: 500;"><a style = "text-decoration:none" href="index.html"><p>home</p></a>
</div>
Suzy
you can set an entire <p> to be a link if you want to...
Umm..are you sure about that Suzy?
It's definitely not like you to be wrong but if I try..
<a href="index.html"><p>home</p></a> then the w3 validator says:
document type does not allow element "P" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag
A <p> can be used as a link but the anchors must be within the paragraph:
<p><a href="link" alt="link">Lots of words</a></p>
will appear as if the entire paragraph is a link and is valid.
As pointed out: <a href="link" alt="link"><p>Lots of words</p></a> is not valid.
I copy/pasted from the first post.. (the downside of only be able to view the first post when replying .... ooops me bad....:()
I had read yours and pageoneresults replies, explaining that the <a>nchor had to be inside the <p> - inline element inside block, which is quite correct... and taken them as read.. ....
I just wanted to add that you could then make the link take up the entire paragraph or div.... display block would do it or absolutely positioning it with width/height/z-index...
Sorry.. for confusion gussie
in this case you might not actually need the both the <p> and the <div> containers one will do... but I still think that z-index may be your answer if your link is still not working...
try this instead....
<div style= "position: absolute; left: 0; top:0; background: #fcf; width: 200px; height: 200px;">
<img src = "indeximages/logo.jpg" width="200" height="200" Alt = "Our name">
</div>
<div style = "position: absolute; left: 0; top:110px; background: #ffc; width: 200px; z:index: 500;">
<a style = "text-decoration:none; display: block; width: 200px;" href = "index.html">home</a>
</div>
You really should set widths/heights on absolutely positioned elements too and setting background colors (temporarily) shows where each element is..
you can then play with the width of the <a> and the top/left co-ordinates of it's container to position it where required.
Suzy
It doesn't seem to be a z-index problems, as I set the index as suggested and it still doesn't work. I'd like to try this on another browser, but my computer died a few weeks ago and I still haven't gotten my hard disk with all my browsers back. Hopefully, things will be back to normal this week and I can do some more testing.
However, I did clean up the code as suggested. The <p> was there to force some formatting that is better done within the link.
<div style= "position: absolute; left: 0; top:0; background: #fcf; width: 174px; height: 864px;">
<img src = "indeximages/logo.jpg" width="174" height="864" Alt = "Our name">
<div style = "position: absolute; left: 40; top:110px; background: #ffc; width: 200px;">
<a style = "text-decoration:none; display: block; width: 200px;" href = "index.html">home</a>
</div>
</div>