1 reply [Last post]
Anthonya
Anthonya's picture
Offline
newbie
Last seen: 7 years 27 weeks ago
Timezone: GMT-4
Joined: 2014-03-16
Posts: 1
Points: 2

Greetings!

I'm a self-taught (most of what I know is from internet webpages) and I recently discovered CSS animations. My question in quite simple: Do animations have to be for div ID's or is there a way of making one for a cell of a table using td class?

For example, I've been trying to do this:

<html>
<head>
<style>
td.tabcontent
{
width:96px;
height:40px;
background: url(<a href="http://img15.hostingpics.net/pics/745218tab.png" rel="nofollow">http://img15.hostingpics.net/pics/745218tab.png</a>) no-repeat;
}
 
td.tabcontent:hover
{
width:96px;
height:40px;
background: url(<a href="http://img15.hostingpics.net/pics/503061tabactive.png" rel="nofollow">http://img15.hostingpics.net/pics/503061tabactive.png</a>) no-repeat;
-webkit-animation:mymove 2s;
}
 
@-webkit-keyframes mymove
{
from {background: url(<a href="http://img15.hostingpics.net/pics/745218tab.png" rel="nofollow">http://img15.hostingpics.net/pics/745218tab.png</a>) no-repeat;}
to {background-color: url(<a href="http://img15.hostingpics.net/pics/503061tabactive.png" rel="nofollow">http://img15.hostingpics.net/pics/503061tabactive.png</a>) no-repeat;}
}
 
</style>
</head>
 
<body>
<table><tr><td class="tabcontent"></td></tr></table>
</body>
</html>

The code is supposed to show a tab which changes when the mouse is hovering. Is there a way of doing that or, by definition, do animations work only for ID's in divs?

exoskeletor
exoskeletor's picture
Offline
newbie
Ελλάδα
Last seen: 7 years 15 weeks ago
Ελλάδα
Timezone: GMT+3
Joined: 2011-07-22
Posts: 7
Points: 11

i dont think you can do that

i dont think you can do that in tables. put the table in a div