Results 1 to 10 of 10

Thread: DD Color Tabs II - Table cells

  1. #1
    Join Date
    Aug 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question DD Color Tabs II - Table cells

    I'd like to convert the DD Color Tabs II script to a table with cells.

    http://www.dynamicdrive.com/style/cs...color-tabs-ii/

    I think it's possible to adapt the CSS image background and hover effect to work in a table with cells.

    Any idea on how to do this easily? It would be so much lighter than a typical javascript/DHTML code.

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Just a note: the linked script is NOT DHTML/Javascript

  3. #3
    Join Date
    Aug 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, I know that.

    I just meant that I want to use this CSS code because it's so much leaner than DHMTL/Javascript but I want to adapt it to a table row.

  4. #4
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    Sorry I misunderstood you, my bad. As for the table idea, can I ask why you want to do this? Tables are designed for tabular data not layout. Also even if you did convert it to a table it would require javascript. I recommend you try and use it the way it is.

  5. #5
    Join Date
    Aug 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm still using table layouts because I'm not comfortable enough with all-CSS layouts yet - especially for a dynamic site that will be hooked up to a database.

    Therefore, the existing <div> layout is cumbersome at the top of the page and would be better in a simple table row with cells.

    (However, that said, I did apply the CSS script as is and it worked and looks fine in preview mode - but looks crazy in edit mode.)

    I might just do a simple hover effect without the tab images.

    I guess my question is, can I have two background images in a table cell with CSS? One would be the tab image and the other would be the mouseover highlight (hover).

  6. #6
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    yes you can...

    Code:
    <style type="text/css">
    <!--
    td {
         background: #ffffff url('link.gif');
    }
    td:hover {
        background: #000000;
    }
    // -->
    </style>
    where #ffffff is equal to some hexadecimal color code
    and link.gif is equal to some image that you want to be displayed in the background...

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    pissa: In the normal "td" how come you have written the below in red:

    Code:
    td {
         background: #ffffff url('link.gif');
    }
    I'm not sure why the "#ffffff" is there. The gif should be able to sit on it's own.
    - Mike

  8. #8
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    pissa: In theory yes, but in IE no. IE only supports the hover pseudo-class on anchors(<a>).

    mburt: You should always provide a backup incase the user can't(or doesn't want to) download your background image

  9. #9
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Ok, thanks. It just looked a little odd

    Yeah, I forgot to mention about the hover pseudo-class, which in IE only works for anchors.

    Completely off topic: blm126 has 103 posts, and I have 301. Whoa... I'm amazed (completely ignore this)
    - Mike

  10. #10
    Join Date
    Aug 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay, thanks.

    So, if I have two graphics (left and right), how would that affect the CSS code?

    And how do I put that in the HTML?

    Say I have a table with four cells:

    Home About Info Stuff

    Not sure how to plug that into the cells.

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
  •