View Full Version : Changed cell background with css?
The_Walrus
02-21-2003, 05:34 PM
is there a way to change the cell background of a table with CSS if it is a link?
Basically i would like the contents of the cell to change to an image when hovered, is it possible with css, or do i need to use javascript?
cg9com
02-21-2003, 06:55 PM
a combination of both actually.
you could add some mouseover event handlers inside your cell.
and use CSS to customize everything to your needs.
Javascript:
onmouseover="this.className='class2';"
onmouseout="this.className='class';"
CSS:
.class {
css
}
.class2 {
css
}
the javascript can be entered into your <td> cell.
the css, in an external sheet, or in your document inside the <style></style> tags.
The_Walrus
02-21-2003, 07:42 PM
thanks i think i will try this method.
cg9com
02-23-2003, 04:23 AM
no problem, eventually when it is completely supported, we will be able to use the :hover pseudoclass on most any element.
eliminating the javascript completely.
redhead
02-23-2003, 04:21 PM
its supported at least on <td>'s by browsers such as mozilla... but not IE unfortunatley...:rolleyes:
Bosko
02-23-2003, 05:46 PM
Originally posted by redhead
its supported at least on <td>'s by browsers such as mozilla... but not IE unfortunatley...:rolleyes:
You can use pseudo-elements on all elements in all browsers except Internet Explorer.
cg9com
02-23-2003, 07:28 PM
which is why i said when its "completely supported"
redhead
02-23-2003, 07:46 PM
...and rightly so :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.