#1
  1. Ruby On Rails Junkie
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    535
    Rep Power
    104

    change css border-color of a table with onmouseover?


    hi all.

    is there a way to change the css border-color attribute of a table with onmouseover? so the table, where the mouse is on, is highlighted in a new color?

    thanks.

    j0sh
    God, you gave man penis and brain, but only enough blood to run one at a time.

    my webpage: www.josh.ch
    my current project: phpmywebmin.josh.ch - a browser based file management application for webspace
  2. #2
  3. nx
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2003
    Location
    USA
    Posts
    626
    Rep Power
    0
    try this:

    Code:
     <table style="border: 1px solid #000000;" onmouseover="this.style.border = '1px solid #ffff00'" onmouseout="this.style.border = '1px solid #000000'">
     <tr>
     <td>
     some text
     </td>
     </tr>
     </table>
    (_)
  4. #3
  5. Ruby On Rails Junkie
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    535
    Rep Power
    104
    thats it! thank you
    God, you gave man penis and brain, but only enough blood to run one at a time.

    my webpage: www.josh.ch
    my current project: phpmywebmin.josh.ch - a browser based file management application for webspace
  6. #4
  7. No Profile Picture
    contains a pressurised widget
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    NC USA
    Posts
    401
    Rep Power
    12
    you can also do this with straight css:
    Code:
    table {border : black solid 1px }
    table:hover {border : red dotted 1px }
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    1
    Rep Power
    0
    I am creating a table containing thumbnails. The table has 4 colums, and 11 rows... I am trying to implement a CSS code to have it so that the borders turn white when the pointer is above a specific thumbnail. I want to use a style sheet to cut bad on excessive code, and reduce the size of the html file a little bit.

    The basic question is, where should this Style code be located, and how to I reference the individual cells back to it.. again, I am trying to have the borders be black, and an onmouseover changing them to white.

    Thanks
    -Zach G.
  10. #6
  11. Ruby On Rails Junkie
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    535
    Rep Power
    104
    you can save it somewhere into a .css file:

    ---style.css---

    .thumbnailBordercolor
    {
    border-color:blue;
    border:1px solid;
    }

    .thumbnailBordercolor:hover
    {
    border-color:red;
    }

    ---end file---

    then include it with the following link in the header:

    <link rel='stylesheet' type='css/text' href='path/to/stylesheet/style.css'>

    the created class ".thumbnailBordercolor" can be included in your cells with

    <td class='thumbnailsBordercolor'> ...

    or in the image-tag

    <a href='...' class='thumbnailsBordercolor'>

    i hope this works.

    gr33tz
    j0sh
    God, you gave man penis and brain, but only enough blood to run one at a time.

    my webpage: www.josh.ch
    my current project: phpmywebmin.josh.ch - a browser based file management application for webspace

IMN logo majestic logo threadwatch logo seochat tools logo