Search code examples
c#asp.netcsshoverascx

Hover table in ascx


I have a table with some rows in an ascx-Control.

How can I add a hover-effect for a row for changing backgroundcolor or font-color,...

thank you


Solution

  • Without JavaScript/jQuery you can use pure CSS...

        <head>
            <title></title>
            <style>
                .changecolor:hover
                {
                    background-color: Blue;
                    color: Red;
                }
            </style>
        </head>
        <body>
            <table>
                <tr class="changecolor">
                    <td>
                        Hello
                    </td>
                </tr>
            </table>
    </body>