CSS 색상

색상을 지정하는 것은 предопределенные 색상 이름, 또는 RGB, HEX, HSL, RGBA, HSLA 값으로 합니다.

CSS 색상 이름

CSS에서는 색상을 이름을 사용하여 지정할 수 있습니다:

토마토
오렌지
도저블루
미디어세아그린
그레이
슬레이트블루
보라색
LightGray

직접 시도해보세요

CSS/HTML 지원 140가지 표준 색상 이름

CSS 배경색

HTML 요소에 배경색을 설정할 수 있습니다:

Welcome to China
China is a great country!

예제

<h1 style="background-color:DodgerBlue;">China</h1>
<p style="background-color:Tomato;">China is a great country!</p>

직접 시도해보세요

CSS 텍스트 색상

하단의 텍스트 색상을 설정할 수 있습니다:

China

China is a great country!

China, officially the People's Republic of China, is a country in East Asia.

예제

<h1 style="color:Tomato;">China</h1>
<p style="color:DodgerBlue;">China is a great country!</p>
<p style="color:MediumSeaGreen;">China, officially the People's Republic of China...</p>

직접 시도해보세요

CSS 경계선 색상

하단의 색상을 설정할 수 있습니다:

Hello World
Hello World
Hello World

예제

<h1 style="border:2px solid Tomato;">Hello World</h1>
<h1 style="border:2px solid DodgerBlue;">Hello World</h1>
<h1 style="border:2px solid Violet;">Hello World</h1>

직접 시도해보세요

CSS 색상 값

CSS에서는 RGB 값, HEX 값, HSL 값, RGBA 값 또는 HSLA 값을 사용하여 색상을 지정할 수 있습니다:

색상 이름 "Tomato"와 동일합니다:

rgb(255, 99, 71)
#ff6347
hsl(9, 100%, 64%)

색상 이름 "Tomato"와 동일하지만 투명도가 50%입니다:

rgba(255, 99, 71, 0.5)
hsla(9, 100%, 64%, 0.5)
<h3>예제</h3>
<h1 style="background-color:rgb(255, 99, 71);">...</h1>
<h1 style="background-color:#ff6347;">...</h1>
<h1 style="background-color:hsl(9, 100%, 64%);">...</h1>
<h1 style="background-color:rgba(255, 99, 71, 0.5);">...</h1>
<h1 style="background-color:hsla(9, 100%, 64%, 0.5);">...</h1>

직접 시도해보세요

색상 값에 대한更多信息를 알아보세요

다음 장에서는 RGBHEXHSL 더 많은 지식.