如何仅在鼠标悬停时连续显示按钮?

问题描述:

我想显示一个关闭按钮以显示在最后一列的行中(将鼠标悬停在该行上) 我不希望关闭按钮始终可见,而只是将鼠标悬停在上面.

I would like to show a close button to be display on a row in a last column (while mouse over on that row) I don't want the close button to be always visible but just on a mouse over.

如果有人举个例子,将不胜感激.

If anyone has an example that would be greatly appreciated.

这是非常简单的示例

css

table a{
    display: none;
}
table tr:hover a{
    display: inline;
}

和html

<table>
    <tr>
        <td>12</td>
        <td>asdasd</td>
        <td><a href="">Close</a></td>
    </tr>
    <tr>
        <td>12</td>
        <td>asdasd</td>
        <td><a href="">Close</a></td>
    </tr>
    <tr>
        <td>12</td>
        <td>asdasd</td>
        <td><a href="">Close</a></td>
    </tr>
    <tr>
        <td>12</td>
        <td>asdasd</td>
        <td><a href="">Close</a></td>
    </tr>
    <tr>
        <td>12</td>
        <td>asdasd</td>
        <td><a href="">Close</a></td>
    </tr>
    <tr>
        <td>12</td>
        <td>asdasd</td>
        <td><a href="">Close</a></td>
    </tr>
</table>