html - 悬停在按钮上时如何反转按钮渐变
问题描述
将鼠标悬停在按钮上时如何反转渐变?请参阅此处的“阅读更多”按钮以查看此效果:https ://carney.co/daily-carnage/ 。请注意,当您将鼠标悬停在按钮上时,黄色向左移动,粉红色向右移动。
我尝试关闭按钮容器上的转换以查看它是否是这样做的,但即使禁用它,悬停效果仍然存在。
将鼠标悬停在按钮上时,我希望黄色现在位于左侧,粉红色位于右侧(如此颠倒)
解决方案
反转渐变hover
HTML
<div id="dd">This is div</div>
CSS
#dd {
background: linear-gradient(to bottom right, yellow, #ff0066);
}
#dd:hover {
background: linear-gradient(to top left, yellow, #ff0066);
/* or */
/* background: linear-gradient(to bottom right, #ff0066, yellow); */
}
推荐阅读
- python - 通过固定大小的python数据套接字发送整数
- apache - Modsecurity & Apache:如何通过标头限制访问速率?
- events - 最小化 Tcl/Tk 时也启用绑定
- python - 如何处理python和索引中不同大小的列表(列表索引)
- css - 悬停时显示材质复选框动画
- ruby-on-rails - ActionView::Template::Error(数据库和 Ruby 的时区信息不一致
- api - 如何在线获取 Quickbooks 的 EntityID?
- php - php - 使用复选框在循环内更新mysql
- python - devpi 索引中的 toxresult_upload 权限
- ios - 有没有办法在 iOS 设备上运行 r