2017-12-09 33 views
0

학교 웹 사이트에서 많은 CSS 속성을 배웠습니다. 그러나 스크롤바의 색상을 변경할 수있는 방법을 알고 싶습니다. 예 :CSS를 사용하여 스크롤바 색상을 변경할 수있는 방법

html { 
    scrollbar-arrow-color: white; 
    scrollbar-face-color: green; 
    scrollbar-face-hover-color: darkGreen; 
    scrollbar-shadow-color: black; 
    scrollbar-track-color: black; 
} 

어쩌면 화살표 버튼의 배경을 변경하는 것도 가능합니다.

답변

0

는 다음과 같은 속성을 사용하여 스크롤의 모양을 변경할 수 있습니다 켜집니다 호버에

body::-webkit-scrollbar 

다음 코드는 빨간색으로 스크롤 바의 배경색을 변경합니다 그것을 파란색

body::-webkit-scrollbar-thumb { 
background-color: red; 
outline: 1px solid slategrey; 
} 

body::-webkit-scrollbar-thumb:hover { 
background-color: blue; 
outline: 1px solid slategrey; 
} 

이 주제를 더 잘 이해하기 위해이 페이지를 살펴 보는 것이 좋습니다.

https://css-tricks.com/almanac/properties/s/scrollbar/

+0

이미 알고 있습니다. 그러나 IE11에서는 효과가 없습니다. IE11 이하의 속성으로 처리하려고합니다. – Migats21

1

이렇게 할 수 있습니다.

::-webkit-scrollbar-face{ background: black;} ::-webkit-scrollbar-face:hover {background: darkGreen;}

색이 다른 색으로 얼굴 떠오르게.