마우스를 올려 놓을 때 섹션 배경색을 변경하는 데 어려움을 겪고 있습니다. 전체 섹션을 링크로 전환하려고합니다. 지금은 섹션 내부의 요소 만 링크가되고 블록 자체는 아닙니다.마우스 오버시 변경할 배경색을 얻을 수 없습니다.
<a>
이전에 <section>
을 제거하면 전체 블록이 링크가되지만 마우스 오버시 배경 씰이 변경되지 않습니다. 나는 메뉴에서 똑같은 시나리오를 가지고있다. 그래서 나는 약간 혼란 스럽다. 나는 또한 왜 요소 만이 섹션과 링크로 바뀌고 내 하위 메뉴에서 반대가되는지 궁금해. 아래 제 코드 : 나는 이상 마우스 변경 섹션의 배경 색상을 얻기과 사투를 벌인거야
.ch-section {
position: relative;
min-height: 140px;
max-height: 140px;
width: 400px;
color: $ch-section-text;
font-size: 13px;
border-bottom: 1px solid $body-1px-line;
}
.ch-section a {
display: block;
width: 400px;
text-decoration: none;
}
.ch-section a.active {
font-weight: bold;
}
.ch-section a:hover:not(.active) {
background-color: yellow;
color: $sn-list-link-active;
}
<section class="ch-section">
<a href="#">
<span class="ch-section-selected not"></span>
<img class="ch-section-image" src="assets/images/profileimg2.png" alt="img">
<span class="ch-section-user">
<span class="ch-section-status online"></span>
<span class="ch-section-name">Lindset T. Peters</span>
<span class="ch-section-location">Location, Province</span>
</span>
<time class="ch-section-date">8:48 AM</time>
<i class="fa fa-e1-message-sent ch-section-message"></i>
<span class="ch-section-snippet">Hey, it was really good to see you over the weekend, I look forward to...</span>
</a>
</section>
. 브라우저 호환성 문제가있는 것 같습니다. 또는 원하는 목표/쟁점이 무엇인지 분명히해야합니다. 어떤 경우에도 마우스 오버 상태는 Chrome에서 작동합니다. 또한 "요소가 링크로 변하는 이유 ..."부분은 그 자체로 또 하나의 질문이며 별도로 질문해야합니다. – Joshua
배경은 무엇입니까? css에'background' 명령이 없습니다. – Roysh
섹션 인 경우 section : hover {background : 여기에 이미지 또는 색상}을 추가 할 수 있습니다. – Roysh