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

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

WBOY
WBOYoriginal
2016-06-21 09:01:381898parcourir

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

你可以结贴了。。
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn