부모 목록 항목을 마우스로 가리키면 의사 요소를 사용하여 여러 이미지를 추가하려고합니다. Chrome에서 검사 할 때 의사 요소가 나타나지만 .png가 제대로 렌더링되지 않습니다. 선택기를 제대로 사용하고 있는지 또는 코드에 다른 문제가 있는지 궁금합니다. 이 here의 실제 예를 볼 수 있습니다.부모 요소에 렌더링되지 않는 의사 요소 이미지 : 호버
이<main>
<section id="results">
<ul>
<li class="term-list">
<dl>
<dt class="term">hello</dt>
<dd class="pronounce">[ <strong>he</strong>-lo ]</dd>
</dl>
</li>
<li class="term-list">
<dl>
<dt class="term">word</dt>
<dd class="pronounce">[ <strong>wurd</strong> ]</dd>
</dl>
</li>
<li class="term-list">
<dl>
<dt class="term">another</dt>
<dd class="pronounce">[ uh-<strong>nuth</strong>-er ]</dd>
</dl>
</li>
<li class="term-list">
<dl>
<dt class="term">aviation</dt>
<dd class="pronounce">[ ay-vee-<strong>ay</strong>-shun ]</dd>
</dl>
</li>
<li class="term-list">
<dl>
<dt class="term">hello</dt>
<dd class="pronounce">[ <strong>he</strong>-lo ]</dd>
</dl>
</li>
</ul>
</section>
</main>
CSS : 여기
는 HTML입니다.term-list {
border-top: 1px solid gray;
color: gray;
padding: 15px 10px;
}
.term-list:last-child {
border-bottom: 1px solid gray;
}
.term-list:hover,
.term-list:hover + .term-list {
border-top: 1px solid white;
-webkit-transition: border-top .2s ease-in-out;
-moz-transition: border-top .2s ease-in-out;
-ms-transition: border-top .2s ease-in-out;
-o-transition: border-top .2s ease-in-out;
transition: border-top .2s ease-in-out;
}
.term-list:hover {
color: white;
-webkit-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
-ms-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
cursor: pointer;
}
.term-list:hover::last-child {
border-bottom: 1px solid white;
-webkit-transition: border-bottom .2s ease-in-out;
-moz-transition: border-bottom .2s ease-in-out;
-ms-transition: border-bottom .2s ease-in-out;
-o-transition: border-bottom .2s ease-in-out;
transition: border-bottom .2s ease-in-out;
}
.term-list:hover dl::after {
content: "";
display: inline-block;
position: absolute;
right: 5px;
top: 50%;
margin-top: -20px;
width: 40px;
height: 40px;
background-size: 40px 40px;
background: url("https://preview.c9users.io/patbrennan/demo-project/launchschool/249/dictionary/images/arrow-right.png") 0 0 no-repeat;
}
감사합니다. position/repeat를 지정하면 'background-size'가 지정되어 있어도 렌더링되지 않게되는 이유는 무엇입니까? – patrickb
Rulese의 속성에 관한 것이 아니라 이름 자체에 관한 것입니다. 'background-image'는 이미지 URL 만 지정할 수있는 특정 규칙입니다. 'background' 규칙은 "속기"이며 특정 순서와 구성을 가진 규칙 목록을 선언 할 수 있습니다. 자세한 내용은 다음 링크를 참조하십시오. https://www.w3schools.com/CSSref/css3_pr_background.asp – Adriano