COLOR
<h1 style="background-color:Tomato;">Tomato</h1>
<h1 style="background-color:rgba(225, 11, 61, 0.4);">RGBA</h1>
<h1 style="background-color:#ff7458;">HEX</h1>
색상을 표현할 때는 다양한 방법이 있습니다. 2가지를 설명하자면
- CSS에는 미리 정의된 색상의 이름 tomato, red, green 처럼 이름으로 지정해서 색을 표현하는 방법이 있습니다.
- CSS에 원하는 색상의 값을 RGB로 표현하거나 16진수로 표현하는 방법이 있습니다.
- RGB에는 RGBA가 있는데 A는 투명도를 나타냅니다.
rgb(red, green, blue)
#rrggbb
hsl( 색조 , 채도 , 명도 )
배경색
<h1 style="background-color:violet;">Hello World</h1>
HTML 요소의 배경색을 설정할 수 있습니다.
텍스트 색
<h1 style="color:gray;">Hello World</h1>
텍스트 색상을 설정할 수 있습니다.
테두리 색
<h1 style="border:1px solid blue;">Hello World</h1>
테두리의 색상을 설정할 수 있습니다:
출처
W3Schools.com
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
'Programming > CSS3' 카테고리의 다른 글
CSS 배경 (0) | 2024.08.04 |
---|---|
CSS 기초 (0) | 2024.08.04 |