CSS repeat-linear-gradient() 함수
예시
반복되는 선형 그라데이션:
#grad {
background-image: repeating-linear-gradient(red, yellow 10%, green 20%);
}
아래에서 더 많은 "직접 사용해 보기" 예를 살펴보세요.
정의 및 사용
repeat-linear-gradient() 함수는 선형 그래디언트를 반복하는 데 사용됩니다.
버전: | CSS3 |
---|
브라우저 지원
표의 숫자는 기능을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
-webkit-, -moz- 또는 -o- 뒤에 오는 숫자는 접두사와 함께 작동한 첫 번째 버전을 지정합니다.
Function | |||||
---|---|---|---|---|---|
repeating-linear-gradient() | 26.0 10.0 -webkit- |
10.0 | 16.0 3.6 -moz- |
6.1 5.1 -webkit- |
12.1 11.1 -o- |
CSS 구문
background-image: repeating-linear-gradient(angle | to side-or-corner, color-stop1,
color-stop2, ...);
Value | Description |
---|---|
angle | Defines an angle of direction for the gradient. From 0deg to 360deg. Default is 180deg. |
side-or-corner | Defines the position of the starting-point of the gradient line. It consists of two keywords: the first one indicates the horizontal side, left or right, and the second one the vertical side, top or bottom. The order is not relevant and each of the keyword is optional. |
color-stop1, color-stop2,... | Color stops are the colors you want to render smooth transitions among. This value consists of a color value, followed by an optional stop position (a percentage between 0% and 100% or a length along the gradient axis). |
더 많은 예
예시
다른 반복 선형 그라디언트:
#grad1 {
background-image: repeating-linear-gradient(45deg,
red, blue 7%, green 10%);
}
#grad2 {
background-image: repeating-linear-gradient(190deg, red, blue 7%,
green 10%);
}
#grad3 {
background-image:
repeating-linear-gradient(90deg, red, blue 7%, green 10%);
}
관련 페이지
CSS 튜토리얼: CSS 그라디언트