CSS color 속성은 요소의 텍스트 색상을 설정하는 데 사용됩니다.
구문
CSS 색상 속성의 구문은 다음과 같습니다 -
Selector { color: /*value*/ }
예
다음 예는 CSS 색상 속성을 보여줍니다 -
<!DOCTYPE html> <html lang="en"> <head> <style> div { height: 100px; width: 200px; margin: 10px; display: flex; float: left; font-size: 1.4em; word-spacing: 30px; line-height: 4.5em; border: thin solid blue; border-radius: 40%; text-align: center; color: rebeccapurple; } div + div{ background-color: beige; color: red; text-align: justify; text-decoration: line-through; } </style> </head> <body> <div>One Two</div> <div>Three </div> </body> </html>
출력
이것은 다음 출력을 제공합니다 -
예
<!DOCTYPE html> <html lang="en"> <head> <style> p { margin: 10px; display: flex; float: left; border: 3px groove green; text-align: center; color: rebeccapurple; } span{ background-color: beige; color: red; text-decoration: underline; } </style> </head> <body> <h2>What is Tableau?</h2> <p>Tableau is a Business Intelligence tool for visually analyzing the data. <span>Users can create and distribute an interactive and shareable dashboard, which depict the trends, variations, and density of the data in the form of graphs and charts. </span> Tableau can connect to files, relational and Big Data sources to acquire and process data.</p> </body> </html>
출력
이것은 다음 출력을 제공합니다 -