css CSS动画悬停 - 菜单悬停的效果
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css CSS动画悬停 - 菜单悬停的效果相关的知识,希望对你有一定的参考价值。
#menu-hauptmenue li a
{
position: relative;
}
#menu-hauptmenue li a:after {
position: absolute;
bottom: -10%;
left: 50%;
color: transparent;
content: '•';
text-shadow: 0 0 transparent;
font-size: 1.2em;
line-height: 1;
-webkit-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
pointer-events: none;
}
#menu-hauptmenue li a:hover:after {
color: #13aff0;
text-shadow: 10px 0 #13aff0, -10px 0 #13aff0;
}
li.menu-item > a > span {
position: relative;
}
li.menu-item > a > span:after {
display: block;
background-color: #13aff0;
position: absolute;
bottom: -30%;
left: 0;
content: '';
width: 100%;
height: 2px;
visibility: hidden;
-webkit-transform: scaleX(0);
-ms-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: bottom left;
-ms-transform-origin: bottom left;
transform-origin: bottom left;
-webkit-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
}
li.menu-item > a:hover > span:after {
visibility: visible;
-webkit-transform: scaleX(1);
-ms-transform: scaleX(1);
transform: scaleX(1);
}
li.menu-item > a > span {
position: relative;
}
li.menu-item > a > span:after {
position: absolute;
bottom: -30%;
left: 0;
width: 100%;
height: 3px;
background-color: rgba(0, 0, 0, 0.1);
content: '';
opacity: 0;
-webkit-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
-webkit-transform: translateY(10px);
-ms-transform: translateY(10px);
transform: translateY(10px);
}
li.menu-item > a:hover > span:after {
opacity: 1;
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
}
li.menu-item > a > span {
position: relative;
}
li.menu-item > a > span:after {
position: absolute;
bottom: -30%;
left: 0;
width: 100%;
height: 1px;
background-color: #13aff0;
content: '';
opacity: 0;
-webkit-transition: all 0.25s ease-out;
transition: all 0.25s ease-out;
-webkit-transform: translateY(-10px);
-ms-transform: translateY(-10px);
transform: translateY(-10px);
}
li.menu-item > a:hover > span:after {
height: 2px;
opacity: 1;
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
}
以上是关于css CSS动画悬停 - 菜单悬停的效果的主要内容,如果未能解决你的问题,请参考以下文章
悬停时停止 CSS 动画
jQuery鼠标悬停3d菜单展开动画
在 CSS 悬停效果上,无法选择/应用效果到特定元素?
如何禁用过渡或动画时间的悬停效果,然后在过渡或动画在 css 中完成后启用它?
CSS动画:悬停和悬停
css 具有动画翻转/悬停效果的灰度翻转图像