HTML之按钮hover背景变化

效果动图:

代码示例:

<!DOCTYPE html>
<html>
<head>
<style>
button:hover{
    background: #ccc;
}
.ntrol-layout .cheader .menu-bottom .ht-button {
    min-width: 96px;
    position: relative;
}
.ht-button--small {
    padding: 6px 15px;
    font-size: 14px;
    border-radius: 4px;
}
.ht-button {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: #fff;
    border: 1px solid #ccc;
    border-color: #ccc;
    color: #333;
    -webkit-appearance: none;
    text-align: center;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    -webkit-transition: .1s;
    transition: .1s;
    font-weight: 400;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    padding: 6px 15px;
    font-size: 14px;
    border-radius: 4px;
}
</style>
</head>
<body>

<p><b>注释:</b>:hover 按钮悬停样式。</p>

<button type="button" name="button" class="ht-button ht-button--default ht-button--small">我是按钮</button>

</body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我先来一碗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值