单元格悬停,行悬停

#### 一、单元格悬停

```

<head>

<style>

        table{

            border: 1px solid black;

            width: 100%;

            border-collapse: collapse;

           

        }

        tr,td,th{

            border: 1px solid black;

            text-align: center;

        }

        /* 为行设置悬停 */

        tr:hover{

            background-color: red;

        }

        /* 为单元格设置悬停 */

        td:hover{

            background-color: cadetblue;

        }

    </style>

</head>

<body>

    <table>

        <tr>

            <th>星期一</th>

            <th>星期二</th>

            <th>星期三</th>

            <th>星期四</th>

            <th>星期五</th>

        </tr>

        <tr>

            <td>ROW 1 cell 1</td>

            <td>ROW 1 cell 2</td>

            <td>ROW 1 cell 3</td>

            <td>ROW 1 cell 4</td>

            <td>ROW 1 cell 5</td>

        </tr>

        <tr>

            <td>ROW 2 cell 1</td>

            <td>ROW 2 cell 2</td>

            <td>ROW 2 cell 3</td>

            <td>ROW 2 cell 4</td>

            <td>ROW 2 cell 5</td>

        </tr>

        <tr>

            <td>ROW 3 cell 1</td>

            <td>ROW 3 cell 2</td>

            <td>ROW 3 cell 3</td>

            <td>ROW 3 cell 4</td>

            <td>ROW 3 cell 5</td>

        </tr>

        <tr>

            <td>ROW 4 cell 1</td>

            <td>ROW 4 cell 2</td>

            <td>ROW 4 cell 3</td>

            <td>ROW 4 cell 4</td>

            <td>ROW 4 cell 5</td>

        </tr>

        <tr>

            <td>ROW 5 cell 1</td>

            <td>ROW 5 cell 2</td>

            <td>ROW 5 cell 3</td>

            <td>ROW 5 cell 4</td>

            <td>ROW 5 cell 5</td>

        </tr>

    </table>

</body>

```

![2](sjt57klb1.hd-bkt.clouddn.com/2.gif)

#### 二、按钮样式

```

<head>

    <style>

        input{

            padding: 10px 20px;

            border-radius: 8px;

            color: black;

        }

        .one:hover{

            background-color: rgb(17, 83, 224);

        }

    </style>

</head>

<body>

    <form>

        <table>

            <tr>

                <td><input class="one" type="button" value="Primary"></td>

                <td><input type="button" value="Normal" style=""></td>

                <td><input type="button" value="Dashed" style="border-style:dotted;color: blue;"></td>\

                <td><input type="button" value="Danager" style="border-color: red; color: red;"></td>

                <td><input type="button" value="Link" style="border-style: none;color: blue;"></td>

            </tr>

        </table>

    </form>

</body>

```

![1](sjt57klb1.hd-bkt.clouddn.com/1.gif)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值