>  기사  >  웹 프론트엔드  >  ::before中content插入图片失败了~_html/css_WEB-ITnose

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

WBOY
WBOY원래의
2016-06-21 09:01:381897검색

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

你可以结贴了。。
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.