SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to put a link layer above a table

    Hi!

    I have a table with a calendar with cells that contain the day numbers. Days with activities have a link on the day number. I want to put a layer above the table with a new link that overrides the links in the table below.

    I've had some success. I added an anchor element and positioned it above the table with this class:

    .calendarlink{
    position:absolute;
    top:0px;
    left:0px;
    width:145px;
    display:block;
    height:150px;
    }

    If I set a background color on the anchor element, everything works perfectly.

    But I need to see the layers below, and without a solid background color, it only works outside the cells in the table. This behaviour is consistent in both IE and Firefox.

    Any idea what's going on?

    Regards,

    Vidar

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I assume you've tried setting the z-index of each accordingly? set the calendar link to have a higher z-index than the elements below.

    We would sneed to see an example to give any more advice but you should know that absolute positioning and tables don't go hand in hand very well.

  3. #3
    Object Not Found junjun's Avatar
    Join Date
    Mar 2002
    Location
    northern MI
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure you're approaching this the right way?
    You could just make the numbers of the day with activities into a link, instead of having to place a div on top of it.

    -or- If your days can only hold one activity, place an anchor right inside the TD tags and have all your content (inlcuding the day number) inside it. I made an online calendar app, and that's pretty much what I did, but I had support for several activities (links) on each day.

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can see the code here:

    http://195.26.0.135/testcal

    Junjun:

    I know I could make the day numbers into links. The table below contains links on the dates with activities. But I don't want to alter the code for it, I just want to add a layer on top that links to another page.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I managed to fix it myself.. I added a transparent gif in the anchor tag that was positioned above the table..

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Sorry I didn't get back sooner (haveing trouble with my broadband connection) but glad you fixed it anyway


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •