html - 当光标悬停在按钮上时更改按钮颜色的代码
问题描述
我正在创建一个带有按钮的电子邮件模板。当用户将鼠标悬停在按钮上时,我希望按钮改变颜色。
以下是我为该按钮提供的 HTML 代码。
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{!User.Calendly_Link__c}" style="height:32px;v-text-anchor:middle;width:150px;" arcsize="13%" strokecolor="#1e3650" fillcolor="#ffffff">
<w:anchorlock/>
<center style="color:#38383A;font-family:sans-serif;font-size:13px;font-weight:bold;">Schedule a meeting</center>
</v:roundrect>
<![endif]--><a href="{!User.Calendly_Link__c}"
style="background-color:#ffffff;
border:1px solid #FFC107;
border-radius:4px;
color:#38383A;
display:inline-block;
font-family:sans-serif;
font-size:13px;
font-weight:bold;
line-height:32px;
text-align:center;
text-decoration:none;
width:150px;
-webkit-text-size-adjust:none;
mso-hide:all;"
>Schedule a meeting</a>
</div>
解决方案
这是一个非常简单的示例,您可以参考:
HTML
<button type='button' class='btn' > Submit </button>
CSS
.btn {
background-color: green;
border: 1px solid white;
padding: 10px;
border-radius: 10px;
}
.btn:hover {
background-color: blue;
color: white;
cursor: pointer
}
推荐阅读
- java - 单个实体 Spring Data JPA 中的“自动生成的 PK 作为 Id”和“自动生成的 UUID 作为字符串”
- matlab - Matlab中的同时对角化
- java - java - 如何使用Jackson dataformat.xml 序列化Java 中的LookAndFeel 对象?
- python - 在其他列表中迭代 python 列表
- python - Pandas - 尝试将多个 .txt 文件存储在 .csv 中
- redis - Redis 6 中主副本同步需要哪些 ACL 命令?
- python - python-selenium.common.exceptions.WebDriverException:消息:未知错误
- java - 如何从另一个类访问 MainActivity 对象
- python - 查找具有匹配列名的列的平均值
- javascript - 下拉菜单上的 querySelectorAll 或 h4 文本定位选项?够简单吗?