How to show button in a row only on mouseover?

北城余情 提交于 2019-12-24 05:04:29

问题


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.


回答1:


this is very simple example

css

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

and 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>


来源:https://stackoverflow.com/questions/14478669/how-to-show-button-in-a-row-only-on-mouseover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!