Home  >  Article  >  Web Front-end  >  ::before中content插入图片失败了~_html/css_WEB-ITnose

::before中content插入图片失败了~_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:01:381898browse

.sidenav ul li > img::before {
content: url(images/c1w.png);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
}
.sidenav ul li:hover > img::before{
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}

请问哪里出错了


回复讨论(解决方案)

content: ' ';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000 url('images/c1w.png');

content: ' ';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000 url('images/c1w.png');



不行QAQ~

没人知道吗

知道了,我的天,为什么明明是当前文件夹下的却要用url(../images/c1w.png)而不是ul(images/c1w.png)

知道了,我的天,为什么明明是当前文件夹下的却要用url(../images/c1w.png)而不是ul(images/c1w.png)

你可以结贴了。。
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