728x90
1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html>
<body>
 
<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="color:blue;">I am blue</p>
<p style="font-size:50px;">I am big</p>
 
</body>
</html>
 
cs

 

실행결과

 

 

 

●  HTML 스타일 속성

HTML 요소의 스타일 설정은 style속성 으로 수행 할 수 있습니다 .

HTML style속성의 문법 은 다음과 같습니다.

 

<tagname style="property:value;"

 

 

● 배경색

CSS background-color속성은 HTML 요소의 배경색을 정의합니다.

이 예제는 페이지의 배경색을 blue로 설정합니다.

 

1
2
3
4
5
6
<body style="background-color:powderblue;">
 
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
 
</body>
cs

 

실행결과

 

 

 

● 글자 색

 

1
2
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
 

 

실행결과

 

 

 

●텍스트 정렬

CSS text-align속성은 HTML 요소의 가로 텍스트 정렬을 정의합니다.

 

1
2
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
 

 

728x90

+ Recent posts