SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Highlighting table borders with CSS?

    Hi,

    I was wondering if it was possible to change the color of a table border using css. I only know that you can make borders with css.

    What i want to do is to have an image linking to another page inisde a table with a border. Then when a user puts their mouse over the image the table border would change to another color.

    Is this possible?

    Thanks in advance.


    Toly
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sure. Define 2 classes with CSS, one being the default appearance and the second being the mouseover appearance. Then do something like this:
    Code:
    onmouseover="this.className = newclass;"
    It hink that's right.
    Sketch
    Aaron Brazell
    Technosailor



  3. #3
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.

    Could you be a little bit more specific like for instance where do i include that "onmouseover" command?

    I don't know that much about CSS.


    Thanks.


    Toly
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  4. #4
    SitePoint Guru
    Join Date
    Feb 2002
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hiya!

    <a href="put_your_url_here" onmouseover="this.className = newclass;">Click here</a>

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this what you want?

    <html>
    <head>
    <title>blah</title>

    <style>
    #table {
    border-width: 2px;
    border-style: solid;
    border-color: blue;
    width: 500px;
    </style>

    </head>

    <body>


    <table id="table">
    <tr>
    <td>Hello</td>
    </tr>
    </table>

    <p><a href="blah.html" onMouseOver="getElementById('table').style.borderColor='red'">Look at me!</a></p>

    </body>
    </html>

  6. #6
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes... i already got it working with a script similiar to yours. Thanks
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  7. #7
    long gone but not forgotten AljapaCo's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, that was something new... highlighting the borders...

    I might think of a way to use that in a site, thanks!
    T O B I A S - S T R A N D H | visit my site here
    OPERA7 /MSIE6 /FireFox 1.1/Win2000 /ADSL /17" Screen /1024x768
    god doesn't create genius, he clones me.............


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
  •