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

WBOY
Release: 2016-06-24 11:31:17
Original
1917 people have browsed it

.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);
}

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!