Css悬停<a> inside

时间:2015-06-11 09:51:12

标签: html css hover

I had a table, inside the tr there are td which there is a link. well, i want to make a class that can change the color the link inside the td. here is my code:

<style>
    .dihover{transition: .5s;}
    .dihover:hover{background-color:#B7192A; color: white; cursor: pointer;}
    a.setan{color:#7E7E7E;}
    .setan:hover{color:white;}
    tr.dihover a:hover{color:white;}
</style>  

<table>
    <tr class="dihover">
        <td><a class="setan">this supposed to change colors</a></td>
        <td><a class="setan">this supposed to change colors</a></td>
    </tr>
</table>

what did i do wrong? Thank you in advance!

1 个答案:

答案 0 :(得分:1)

我尝试修改您的代码..检查是否符合您的要求 的 HTML

 class Parent {
   public:
     static std::string getName() {
       return s_name;
     }
     const static std::string s_name;
 };


 class Bar1 : public Parent {
   public:
     Bar1() : s_name("Bar1") {}
 };

 class Bar2 : public Parent {
   public:
     Bar2() : s_name("Bar2") {}
 };


 int main() {
   Bar1 b;
   b.getName();
   return 0;
 }

CSS

<table>
<tr class= setan>
    <td><a>this supposed to change colors</a></td>
    <td><a>this supposed to change colors</a></td>
</tr>