Forum Moderators: not2easy

Message Too Old, No Replies

link fails when inside position:absolute div

when the button is in the right place, it can't be clicked

         

bionic_eyes

7:06 pm on Jan 12, 2009 (gmt 0)

10+ Year Member



I'm trying to implement a header with a gradient background and shaped endpoints. It is full page width and includes a button with a link to an external site. (I'm a tech writer working primarily with tool-generated pages, so I may be making elementary mistakes.)

Currently the heading renders as expected, but the button link does not work.
The link works when it is not inside an element with absolute positioning.
Is absolute positioning the real problem? If so, how do I get the same results without it?

DTD xhtml 1.0 strict. CSS and HTML below.

CSS:
#background
{
position: absolute;
left: 0px;
top: 0px;
right: 0px;
width: 100%;
height: 58px;
z-index: 1;
visibility: visible;
background-image: url('images/helpicons/stretch2.gif');
}

#help
{
position: absolute;
left: 0px;
top: 0px;
width: 157px;
height: 58px;
z-index: 2;
visibility: visible;
}

#cs
{
position: absolute;
right: 0px;
top: 0px;
width: 157px;
height: 50px;
z-index: 3;
visibility: visible;
}

#rightend
{
position: absolute;
right: 0px;
top: 0px;
width: 100%;
height: 58px;
z-index: 4;
visibility: visible;
}

HTML
<div id="help" align="left">
<img style="border-style: none;padding: 0;" src="images/helpicons/left.gif" />
</div>
<div id="cs"><a href="http://service.example.com/product/support.html?section=webproduct" target="_blank" title="Click to get assistance from Customer Support" alt="Click to get assistance from Customer Support"><img border="0" style="border-style: none;padding: 0;width: 132px;height: 58px;" src="images/helpicons/button.gif" /></a>
</div>
<div id="background">
</div>
<div id="rightend">
<img src="images/helpicons/right.gif" style="width: 17px;height: 58px;border-style: none;float: right;border-style: none;float: right;padding: 0;" width="17" height="58" align="right" border="0" />
</div>

sectionq

1:54 am on Jan 13, 2009 (gmt 0)

10+ Year Member



At a glance it looks like the right hand div has a higher z-index than the div with the link, as this is set at a 100% width it's covering over the link. Changing #cs divs z-index to a lower number or the other way around should sort this.

sQ

bionic_eyes

6:45 pm on Jan 13, 2009 (gmt 0)

10+ Year Member



yes, that was the problem.