답변:
가장 쉬운 방법은 다음과 같습니다.
ul li:after {
content: url('../images/small_triangle.png');
}
<!DOCTYPE html>
이 시도:
ul li a:after {
display: block;
content: "";
width: 3px;
height: 5px;
background: transparent url('../images/small_triangle.png') no-repeat;
}
content: "";컨텐츠가 "아무것도"없는 경우에도 생성 된 요소 컨텐츠를 제공 하려면 선언 이 필요합니다 .
또한 background선언 의 구문 / 순서를 수정했습니다 .
left: 50%중간에 정렬되지 않으므로 위치를 지정할 수 없습니다 . left: 0; width: 100%대신 배경 위치를 사용 하고 50 %로 설정하십시오. 나를 위해 잘 작동합니다. 필수 content속성 에 대한 팁을 주셔서 감사 합니다.
background-size: container
IE8 지원의 경우 "content"특성은 비워 둘 수 없습니다.
이 문제를 해결하려면 다음을 수행하십시오.
.ul li:after {
content:"icon";
text-indent:-999em;
display:block;
width:32px;
height:32px;
background:url(../img/icons/spritesheet.png) 0 -620px no-repeat;
margin:5% 0 0 45%;
}
참고 : 이것은 이미지 스프라이트에서도 작동합니다