Home >Web Front-end >HTML Tutorial >关于CSS伪类::before和transform的问题_html/css_WEB-ITnose

关于CSS伪类::before和transform的问题_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:31:171936browse

.sidenav ul li::before{
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #FE8A03;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
}
.sidenav ul li:hover::before{
-webkit-transform: translate3d(0 0, 0);
transform: translate3d(0, 0, 0);
}

请问哪里出错了~ 为什么没有效果
第一个没错能看见,就hover设置之后没效果。


回复讨论(解决方案)

.sidenav ul li::before{
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #FE8A03;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
} 多了个}
.sidenav ul li:hover::before{
-webkit-transform: translate3d(0 , 0, 0); 少了个,
transform: translate3d(0, 0, 0);
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn