不能用css悬停在图像链接里面

时间:2015-01-01 11:57:57

标签: html css

我试图将鼠标悬停在我的图片链接中但失败了,你们可以帮我修复吗

这是我的代码

<div class="container" id="link">
    <table border="1" width="1140px" height="600px" id="link" >
        <tr id="link">
            <td valign="top" id="link" >
                <table border="0" width="100%" id="link">

这是我的css

#link A:link {text-decoration:none;  color:#000; background-color:none;}
#link A:lvisited {text-decoration:none;  color:#000; background-color:none;}
#link A:active {text-decoration:none;  color:#000; background-color:none;}
#link A:hover {text-decoration:none;  color:#D8CCDE; background-color:none;;
                        -webkit-transition: all 0.7s ease;
                        -webkit-transition: all 0.7s ease;
                        -moz-transition: all 0.7s ease;
                        -ms-transition: all 0.7s ease;
                        -o-transition: all 0.7s ease;
                        transition: all 0.7s ease;}

    .clearfix{
    clear :both;
    }

1 个答案:

答案 0 :(得分:0)

像这样?正如其他答案所说,id应该是唯一的,保持风格分离和valign attr弃用

&#13;
&#13;
a img:hover{border:2px solid red;}
&#13;
<div id="container">
  <table>
    <tr>
      <td>
        <table>
          <tr>
            <td>
              <a href="http://www.google.com">
                <img src="http://lorempixel.com/100/100" width="100" height="100" />
              </a>
              </td>
            </tr>
          </table>
       </td>
    </tr>
   </table>
 </div>
&#13;
&#13;
&#13;