기록

HTML - 학습 1차(링크, 이미지 표현, 글꼴, 글꼴색, 태그 및 줄바꿈)

  • 기본 코드 -
<!DOCTYPE html>

<html lang="en">

<body style="background-color:powderblue;">

<h1> My First Heading </h1>

<p> My First Heading. </p>

<p> My First <br> Heading. </p>

<a href="http://www.naver.com"> Link</a>

<br>

<img  src="E:\3.VEC\0.Work\4.스마트 축산\비문 이미지\7월23일_CAM1_2\00001_E_0_200723.bmp" alt="Sung IL">

<p style="color:red;">This is a red paragraph.</p>

<p style="color:red;">I am red</p>

<p style="color:blue;">I am blue</p>

<p style="color:red; font-size:50px;">I am big</p>

<p title="I'm a tooltip">This is a paragraph.</p>

<h1 style="background-color:powderblue;">This is a heading</h1>

<p style="text-align:center; font-size:160%; font-family:courier; color:red; background-color:tomato;">This is a paragraph.</p>

<b>This text is bold</b>

</body>
</html>

기초 지식
html의 시작과 끝은 항상 <태그> </태그> 이다.
html의 태그는 대소 문자를 구분 하지 않는다. <HTML> 과 <html> 은 동일하다. (소문자를 사용 권장)

코드 분석
<!DOCTYPE html> : html 을 사용하겠다는 선언으로 head와 동일
<html> : html을 시작하겠다는 대 괄호 라고 이해하면 편하다.

<html lang="en"> : 사이트의 언어를 설정, "en-US" 로 국가별 언어 설정 가능

<body> : main문을 알리는 신호
<body style="background-color:powderblue;"> : 백그라운드에, 색상을 입히겠다는 설정

<h1> 은 글씨의 크기를 나타내며, h1 ~ 6 까지 존재한다.
<p> 는 엔터키와 같은 역할을 한다.
<br>은 반대 태그가 없는 엔터키와 같은 역할을 수행한다.
<a href= "대상 주소 "> 대체 택스트 </a> : link를 탈수 있다.

<img src = " 이미지 경로 " alt = "대체 텍스트"> : 이미지 파일을 표현 할수 있다.

<p style="color:red;">This is a red paragraph.</p> : 글씨의 특성과 색상을 설정
<p style="color:red; font-size:50px;">I am big</p> : 글씨의 크기와, 색상을 동시 지정

<p title="표현할 텍스트">This is a paragraph.</p> : 출력된 텍스트 위에 마우스를 올리면, 출력 텍스트가 표현 된다.

<h1 style="background-color:powderblue;">This is a heading</h1>

<p style="text-align:center; font-size:160%; font-family:courier; color:red; background-color:tomato;">This is a paragraph.</p>

text-align:center; -> 글씨 위치
font-size:160%; -> 글씨 크기
font-family:courier; -> 글꼴
color:red; -> 글씨 색상
background-color:tomato; -> 백그라운드 색상

</body>
<html> -> 시작 과 반대 순서로..


주요 기능

<태그 이름 style = " 속성 값 " >

댓글

이름만 적고 남길 수 있어요