CSS rgba() 함수
예시
불투명도(RGBA)로 다양한 RGB 색상 정의:
#p1 {background-color:rgba(255,0,0,0.3);} /* red with opacity*/
#p2 {background-color:rgba(0,255,0,0.3);} /* green with opacity */
#p3 {background-color:rgba(0,0,255,0.3);} /* blue with opacity */
정의 및 사용
rgba() 함수는 RGBA(Red-Green-Blue-alpha) 모델을 사용하여 색상을 정의합니다.
RGBA 색상 값은 색상의 불투명도를 지정하는 알파 채널이 있는 RGB 색상 값의 확장입니다.
버전: | CSS3 |
---|
브라우저 지원
표의 숫자는 기능을 완전히 지원하는 첫 번째 브라우저 버전을 지정합니다.
Function | |||||
---|---|---|---|---|---|
rgba() | 1.0 | 9.0 | 3.0 | 3.1 | 10.0 |
CSS 구문
rgba(red, green, blue, alpha)
Value | Description |
---|---|
red | Defines the intensity of red as an integer between 0 and 255, or as a percentage value between 0% and 100% |
green | Defines the intensity of green as an integer between 0 and 255, or as a percentage value between 0% and 100% |
blue | Defines the intensity of blue as an integer between 0 and 255, or as a percentage value between 0% and 100% |
alpha | Defines the opacity as a number between 0.0 (fully transparent) and 1.0 (fully opaque) |