CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 24th, 2004, 11:47 AM
bigtommym bigtommym is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 22 bigtommym User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
cell formatting

Hi,

Really new to this css stuff and i'm sure i'll get a beratting for asking such a simple question but here goes...

What i need is a cell with a linked word in it. Initial state is white background with blue text. On rollover i would like the whole cell to turn blue with white text.

I'm sure this is simple but just need a point in the right direction.

Thanks for any help

Tom

Reply With Quote
  #2  
Old June 24th, 2004, 12:05 PM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
It's a good question actually, no beratting here ,

You can use the 'hover' psuedoclass on almost any tag including table, td, and tr.

CSS
PHP Code:
 td:hover{background-color:#0000FF;}
td:hover a{background-color:#0000FF; color:#FFFFFF;}
td a:hover{color:#FFFFFF}
td a{color:#0000FF} 

#FFFFFF; = white
#0000FF; = blue

EDIT: Actually, that only works in Firefox. It's fairly borked in IE. The only suggestion that I have for you would be to use javascript, which I know can do it, I just don't know how.

Last edited by 1beb : June 24th, 2004 at 12:33 PM.

Reply With Quote
  #3  
Old June 24th, 2004, 12:52 PM
TheJim01's Avatar
TheJim01 TheJim01 is offline
Coconuts migrate?
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2004
Location: http://middle.nowhere.com
Posts: 1,895 TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)TheJim01 User rank is General 3rd Grade (Above 100000 Reputation Level)  Folding Points: 70160 Folding Title: Intermediate FolderFolding Points: 70160 Folding Title: Intermediate FolderFolding Points: 70160 Folding Title: Intermediate FolderFolding Points: 70160 Folding Title: Intermediate Folder
Time spent in forums: 2 Weeks 5 Days 11 h 8 m 20 sec
Reputation Power: 1176
While this is really a solution for the javascript board...
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<
html>

<
head>

  <
title>CSS Background Color-Changer</title>

  <!-- <
link rel="stylesheet" type="text/css" href="style.css" media="all" /> -->

  <
style type="text/css">
  
span{
    
border1px blue solid;
    
padding5px;
    
margin0px;
    
margin-top5px;
    
width200px;
    
displayblock;
  }
  
div{
    
border1px #AAAAAA solid;
    
displayblock;
  }
  .
hover1{
    
backgroundred;
  }
  .
hover2{
    
backgroundgreen;
  }
  .
hover3{
    
backgroundblue;
  }
  .
hover4{
    
backgroundwhite;
  }
  .
hover5{
    
backgroundcyan;
  }
  .
hover6{
    
backgroundmagenta;
  }
  .
hover7{
    
backgroundyellow;
  }
  .
hover8{
    
backgroundblack;
  }
  </
style>

</
head>

<
body>

<
center>
<
div id="mydiv" class="hover1" style="height: 200px; width: 200px;"></div><br />
<
span onmouseover="document.getElementById('mydiv').className='hover1';">red</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover2';">green</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover3';">blue</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover4';">white</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover5';">cyan</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover6';">magenta</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover7';">yellow</span><br />
<
span onmouseover="document.getElementById('mydiv').className='hover8';">black</span><br />
</
center>

</
body>

</
html


You can also use the "this" object:
PHP Code:
<td class="hover1" onmouseover="this.className='hover2';" onmouseout="this.className='hover1';">content</td

Though I've had some trouble with the "this" method of doing it.

Hope this helps!
__________________

Proud member of the T.S.N.B.U.F.L (tables should not be used for layout) alliance.

"Only use elements for their intended purpose. You wouldn't try to make coffee with a telephone, would you?" -Me

Last edited by TheJim01 : June 24th, 2004 at 12:55 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > cell formatting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT