HTML Sections & Outlines

1. ꡬ쑰적 λ§ˆν¬μ—…μ˜ 이해

  • ꡬ쑰적 λ§ˆν¬μ—…μ€ λ¬Έμ„œμ˜ ꡬ쑰λ₯Ό μ •μ˜

  • ν‘œν˜„μ  λ§ˆν¬μ—…μ€ λ¬Έμ„œμ˜ μ™Έν˜•μ„ μ •μ˜

  • ꡬ쑰적 λ§ˆν¬μ—…κ³Ό ν‘œν˜„μ  λ§ˆν¬μ—…μ˜ 혼용

    • 였래된 HTML은 ꡬ쑰적 λ§ˆν¬μ—…κ³Ό ν‘œν˜„μ  λ§ˆν¬μ—…μ„ ν˜Όμš©ν•΄ μ‚¬μš©

    • ν˜„μž¬ μ›Ή ν‘œμ€€μ—μ„œλŠ” ν‘œν˜„μ  λ§ˆν¬μ—…μ„ HTMLμ—μ„œ ν‡΄μΆœ

    • λ¬Έμ„œμ˜ κ΅¬μ‘°λŠ” HTML을 μ‚¬μš©, λ¬Έμ„œμ˜ ν‘œν˜„μ€ CSSλ₯Ό μ‚¬μš©

  • ν‘œν˜„μ  λ§ˆν¬μ—… μ‚¬μš©μ˜ 문제점

    • ν‘œν˜„μ  μš”μ†Œμ˜ μ‚¬μš©μ€ 접근성을 μ €ν•΄

    • 더 높은 μœ μ§€λΉ„μš© λ°œμƒ

    • λ¬Έμ„œ 크기 λΉ„λŒ€ν™”

  • 블둝 레벨 μš”μ†Œμ™€ 인라인 레벨 μš”μ†Œ

    • 블둝 레벨 μš”μ†Œ: 쀄 λ°”κΏˆμ΄ μΌμ–΄λ‚˜λŠ” 단락 μš”μ†Œ

    • 인라인 레벨 μš”μ†Œ: 쀄 λ°”κΏˆμ΄ μΌμ–΄λ‚˜μ§€ μ•ŠλŠ” ν–‰μ˜ 일뢀 μš”μ†Œ

2. Section Elements in HTML5

  • HTML Navigational Element (<nav>)

    • defines a section that contains navigation links that appear often on a site.

    • You can have primary and secondary menus, but you never nest, or put a <nav>element inside a <nav> element.

  • HTML Article Element (<article>)

    • defines a piece of self-contained content.

    • It does not refer to the main content alone and can be used for comments and widgets.

  • HTML Section Element (<section>)

    • defines a section of a document to indicate a related grouping of semantic meaning.

    • Utilize the section element providing extra context from the parent element makes sense.

  • HTML Aside Element (<aside>)

    • defines a section that, though related to the main element, doesn't belong to the main flow, like an explanation box or an advertisement.

    • It has its own outline, but doesn't belong to the main one.

Other Semantic HTML elements used in Sectioning

  • HTML Body Element (<body>)

    • defines all the content of a document.

    • It contains all the content and HTML tags.

  • HTML Header Element (<header>)

    • defines a page which typically contains the logo, title, and navigation.

    • The header can also be used in other semantic elements such as <article>or <section> β€” or section header, containing perhaps the section's heading, author name, etc. <article>, <section>, <aside>, and <nav> can have their own <header>.

    • Despite its name, it is not necessarily positioned at the beginning of the page or section.

  • HTML Footer Element (<footer>)

    • defines a page footer which typically contains the copyright, legal notices and sometimes some links β€” or section footer, containing perhaps the section's publication date, license information, etc. <article>, <section>, <aside>, and <nav> can have their own <footer>.

    • Despite its name, it is not necessarily positioned at the end of the page or section.

3. HTML elements reference from MDN

Main root

Document metadata

Metadata contains information about the page. This includes information about styles, scripts and data to help software (search engines, browsers, etc.) use and render the page. Metadata for styles and scripts may be defined in the page or link to another file that has the information.

<p> : 문단, p μš”μ†Œ 보닀 더 μ ν•©ν•œ μš”μ†Œκ°€ μžˆμ„ λ•Œμ—λŠ” ν•΄λ‹Ή μš”μ†Œλ₯Ό μ‚¬μš©ν•¨
<blockquote> : λ‹€λ₯Έ μ†ŒμŠ€λ‘œλΆ€ν„° κ°€μ Έμ˜¨ 인용 μ„Ήμ…˜
인용된 μ†ŒμŠ€μ˜ URL μ£Όμ†Œκ°€ μžˆλ‹€λ©΄ cite μ†μ„±μœΌλ‘œ ν‘œμ‹œ
<pre> : ν˜•μ‹ν™”λœ ν…μŠ€νŠΈ 블둝을 ν‘œν˜„
<hr> : 문단 λ ˆλ²¨μ—μ„œ 주제의 뢄리, 마침 μš”μ†Œ 없이 λ‹¨λ…μœΌλ‘œ μ‚¬μš©

λͺ©λ‘
- μˆœμ„œκ°€ μžˆλŠ” λͺ©λ‘: μˆœμ„œκ°€ λ°”λ€Œλ©΄ μ˜λ―Έκ°€ λ°”λ€ŒλŠ” λͺ©λ‘
<ol> μš”μ†Œλ‘œ μ •μ˜
<li> μš”μ†Œκ°€ λͺ©λ‘ μ•„μ΄ν…œμ„ μ •μ˜

- μˆœμ„œκ°€ μ—†λŠ” λͺ©λ‘: λͺ©λ‘ μ•„μ΄ν…œμ΄ 말머리 기호둜 μ‹œμž‘
<ul> μš”μ†Œλ‘œ μ •μ˜
<li> μš”μ†Œκ°€ λͺ©λ‘ μ•„μ΄ν…œμ„ μ •μ˜

- μ •μ˜ λͺ©λ‘: 사전식 μ •μ˜λ₯Ό μœ„ν•΄ μ‚¬μš©
<dl> : μ •μ˜ λͺ©λ‘ μš”μ†Œ
<dt> :μ •μ˜ λͺ©λ‘ 제λͺ© μš”μ†Œ
<dd> :μ •μ˜ λͺ©λ‘ 데이터(κ°’) μš”μ†Œ

<figure> :사진, 일러슀트, λΉ„λ””μ˜€ 등을 ν‘œμ‹œ
<figcaption> : figureμš”μ†Œ λ‚΄μš©μ— λŒ€ν•œ μΊ‘μ…˜, <figure> μš”μ†Œ λ‚΄λΆ€μ—μ„œ μ‚¬μš©
<div> :μŠ€νƒ€μΌ λ˜λŠ” 슀크립트 λͺ©μ μœΌλ‘œ μ½˜ν…μΈ λ₯Ό λΆ„λ¦¬ν•˜κΈ° μœ„ν•΄ μ‚¬μš©

μ „μ—­ 속성
- λŒ€λΆ€λΆ„μ˜ μš”μ†Œμ—μ„œ μ†μ„±μœΌλ‘œ μ‚¬μš© κ°€λŠ₯ν•œ μ „μ—­ 속성
- id 속성은 HTML μ½”λ“œ 내에 μœ μΌν•œ μ‹λ³„μž
- class 속성은 HTML μ½”λ“œ 내에 같은 값을 λ‹€μˆ˜ κ°€μ§ˆ 수 있음
- class 속성은 css λ‚˜ μžλ°”μŠ€ν¬λ¦½νŠΈμ—μ„œ HTML μ½”λ“œ λ‚΄ μ—¬λŸ¬ μš”μ†Œμ— λ™μΌν•œ μŠ€νƒ€μΌ λ˜λŠ” μž‘λ™μ„ 적용
ν•˜κΈ° μœ„ν•΄ μ‚¬μš©
- title 속성은 μš”μ†Œμ˜ μ‘°μ–Έ 정보λ₯Ό λ‚˜νƒ€λ‚΄λ©° μ›Ή λΈŒλΌμš°μ €μ—μ„œ 툴팁으둜 ν‘œμ‹œ

ν…μŠ€νŠΈ κ΄€λ ¨ μš”μ†Œ : 인라인 레벨 μš”μ†Œ
<a> ν•˜μ΄νΌλ§ν¬

href μ†μ„±μœΌλ‘œ 링크 경둜λ₯Ό 지정
target 속성은 μ–΄λ–€ μœˆλ„μš°μ—μ„œ 링크가 열릴지 κ²°μ •
_self : ν˜„μž¬μ˜ μ›Ή λΈŒλΌμš°μ € μ°½μ—μ„œ 링크가 μ—΄λ¦Ό
_parent : ν˜„μž¬μ˜ μ›Ή λΈŒλΌμš°μ € 창의 λΆ€λͺ¨ 창이 μžˆλ‹€λ©΄ κ·Έ λΆ€λͺ¨ μ°½μ—μ„œ 링크가 μ—΄λ¦Ό
_top : μ΅œμƒμœ„ μ›Ή λΈŒλΌμš°μ € μ°½μ—μ„œ 링크가 μ—΄λ¦Ό
_blank : μƒˆλ‘œμš΄ μ›Ή λΈŒλΌμš°μ € 창을 μƒμ„±ν•˜κ³  링크가 μ—΄λ¦Ό
- Ii, <em> : λ‚΄μš©μ„ κ°•μ‘°
<strong> : λ‚΄μš©μ΄ μ€‘μš”ν•¨μ„ λ‚˜νƒ€λƒ„

<q> : q μš”μ†ŒλŠ” μΈμš©μ„ λ‚˜νƒ€λ‚΄λŠ” 인라인 μš”μ†Œ
<cite> : μ±…, μˆ˜ν•„, μ‹œ, λŒ€λ³Έ, λ…Όλ¬Έ, κ·Έλ¦Ό, μ—°κ·Ή, μ˜ν™” λ“±κ³Ό 같은 μž‘ν’ˆμ˜ 제λͺ©μ„ μ–ΈκΈ‰ν•˜κ±°λ‚˜ μ°Έμ‘° ν–ˆμ„
λ•Œ μ‚¬μš©
<abbr> : abbr μš”μ†ŒλŠ” μ•½μ–΄ 및 λ‘λ¬Έμžμ–΄λ₯Ό λ‚˜νƒ€λƒ„

title 속성을 μ΄μš©ν•˜μ—¬ λ‘λ¬Έμžμ˜ μ›ν˜•μ„ λ‚˜νƒ€λƒ„
<i> : λ‹€λ₯Έ μ–Έμ–΄ ν‘œμ‹œλ‚˜ μ˜λ¬Έμ—μ„œ μ΄ν…”λ¦­μ²΄λ‘œ ν‘œν˜„ν•˜λŠ” μˆ™μ–΄μΈμš©, λΆ„λ₯˜ν•™ 등에 μ‚¬μš©
<b> :bμš”μ†ŒλŠ” 의미 μžˆλŠ” μ€‘μš”μ„±μ„ λΆ€κ°€ν•˜μ§€ μ•Šκ³  λˆˆμ— λ„κ²Œ ν•˜κΈ° μœ„ν•΄ μ‚¬μš©
<sup>, <sub>
- sup μš”μ†ŒλŠ” μœ„μ²¨μžλ₯Ό λ‚˜νƒ€λ‚Έλ‹€.
- sub μš”μ†ŒλŠ” μ•„λž˜μ²¨μžλ₯Ό λ‚˜νƒ€λ‚Έλ‹€.
<span> :인라인 λ ˆλ²¨μ—μ„œ μŠ€νƒ€μΌμ„ μ μš©ν•˜κ±°λ‚˜ μŠ€ν¬λ¦½νŠΈμ—μ„œ μ‚¬μš©ν•˜κ³ μž μ½˜ν…μΈ λ₯Ό λΆ„λ¦¬ν•˜λŠ” μ—­ν• 
<br> : 마침 μš”μ†Œ 없이 μ‚¬μš©λ˜λ©° 문단 뢄리가 μ•„λ‹Œ λ‹¨μˆœ μ€„λ°”κΏˆμ„ ν‘œμ‹œ
<p> μš”μ†Œ λŒ€μš©μœΌλ‘œ μ‚¬μš©ν•˜λ©΄ μ•ˆλ¨

<img>
- img μš”μ†ŒλŠ” 이미지λ₯Ό 의미.
- img μš”μ†ŒλŠ” 마침 μš”μ†Œκ°€ 없이 λ‹¨λ…μœΌλ‘œ μ‚¬μš©.
- src 속성에 μ΄λ―Έμ§€μ˜ 경둜λ₯Ό 지정.
- alt 속성은 이미지λ₯Ό λŒ€μ²΄ν•˜κΈ° μœ„ν•œ ν…μŠ€νŠΈ. λ°˜λ“œμ‹œ μ‚¬μš©.

4. HTML ν‘œ (Table)

HTML ν‘œμ˜ μ‚¬μš©μ‹œ 주의 점

  • ν‘œλŠ” 접근성이 λ–¨μ–΄μ§€λ―€λ‘œ ν‘œ 이외에 더 쒋은 ν‘œν˜„ 방법이 μžˆλ‹€λ©΄ ν‘œλ₯Ό μ‚¬μš©ν•˜μ§€ μ•Šμ•„μ•Ό ν•œλ‹€.

  • ν‘œλ₯Ό νŽ˜μ΄μ§€ λ ˆμ΄μ•„μ›ƒμ— μ‚¬μš©ν•˜μ§€ 말아야 ν•œλ‹€.

  • μž…λ ₯ μ„œμ‹μ„ λ‚˜νƒ€λ‚Ό λ•Œλ„ λ˜λ„λ‘μ΄λ©΄ ν‘œλ₯Ό μ‚¬μš©ν•˜μ§€ 말아야 ν•œλ‹€.

HTML ν‘œ μž‘μ„±

  • table

  • μš”μ†Œ: HTML ν‘œλ₯Ό μ˜λ―Έν•œλ‹€.

  • tr μš”μ†Œ: ν…Œμ΄λΈ”μ˜ rowλ₯Ό λ‚˜νƒ€λ‚Έλ‹€.

  • th μš”μ†Œ: ν…Œμ΄λΈ” 헀더셀을 λ‚˜νƒ€λ‚Έλ‹€. 제λͺ© 셀에 μ‚¬μš©ν•œλ‹€

  • td μš”μ†Œ: ν…Œμ΄λΈ”μ˜ μ…€(μΉΈ)을 μ˜λ―Έν•œλ‹€.

μ…€ 병합

  • κ°€λ‘œμ…€ 병합: colsapn 속성 μ‚¬μš©

  • μ„Έλ‘œμ…€ 병합: rowspan 속성 μ‚¬μš©

ν‘œμ˜ ꡬ쑰화 μš”μ†Œ

μ ‘κ·Όμ„± 강화와 데이터 뢄석을 μœ„ν•΄ ν‘œλ₯Ό ꡬ쑰화 ν•œλ‹€

  • thead μš”μ†Œ

    • ν‘œμ˜ 제λͺ©μœΌλ‘œ κ΅¬μ„±λœ row의 집합

    • ν‘œμ— 두 개 μ΄μƒμ˜ theadκ°€ μ •μ˜ λ˜μ–΄μ„œλŠ” μ•ˆλœλ‹€.

  • tbody μš”μ†Œ

    • ν‘œμ˜ λͺΈ λΆ€λΆ„μœΌλ‘œ ν‘œμ˜ λ‚΄μš©μ΄ λ“€μ–΄κ°„λ‹€

    • μ—¬λŸ¬ 개의 tbodyμ„€μ • κ°€λŠ₯

  • tfoot μš”μ†Œ

    • ν‘œμ˜ ν‘Έν„°λ‘œ κ΅¬μ„±λœ row의 집합

    • μœ„μΉ˜μ™€ 상관없이 ν‘œ λ§ˆμ§€λ§‰μ— λ‚˜νƒ€λ‚œλ‹€.

    • ν‘œμ— 두 개 μ΄μƒμ˜ tfoot이 μ •μ˜ λ˜μ–΄μ„œλŠ” μ•ˆλœλ‹€

  • col μš”μ†Œ: ꡬ쑰적으둜 ν•˜λ‚˜μ˜ column을 λŒ€ν‘œν•œλ‹€. caption μš”μ†Œμ˜ 뒀에 theadλ‚˜ tbody의 μ•žμ— μ„€μ •ν•œλ‹€. ν‘œμ˜ 컬럼 갯수 만큼 col μš”μ†Œλ₯Ό μ‚¬μš©ν•œλ‹€.

  • colgroup μš”μ†Œ: col μš”μ†Œμ˜ κ·Έλ£Ή ꡬ쑰에 따라 μ—¬λŸ¬κ°œμ˜ colgroup으둜 뢄리할 수 μžˆλ‹€.

  • scope 속성

    • ν—€λ”μ…€μ˜ 영ν–₯λ ₯이 μ–΄λŠμͺ½μœΌλ‘œ ν–₯ν•˜λŠ”μ§€λ₯Ό 지정

    • scope의 값이 row λ˜λŠ” col이면

    • 헀더셀은row λ˜λŠ” column에 제λͺ©

    • scope의 값이 rowgroupλ˜λŠ” colgroup이면 헀더셀은 row의 κ·Έλ£Ή(μ•„λž˜μ— μžˆλŠ” μ—¬λŸ¬ 쀄) λ˜λŠ” col의 κ·Έλ£Ή(μš°μΈ‘μ— μžˆλŠ” μ—¬λŸ¬ μ»¬λŸΌλ“€)의 제λͺ©

  • caption μš”μ†Œ

    • ν‘œμ˜ μΊ‘μ…˜(제λͺ©)을 λ‚˜νƒ€λ‚Έλ‹€.

    • table μš”μ†Œμ˜ 첫 번째 μžμ‹ μš”μ†Œλ‘œ κ°€μž₯ λ¨Όμ € μ„€μ •λ˜μ–΄μ•Ό ν•œλ‹€.

    • table이 figure μš”μ†Œμ˜ μœ μΌν•œ μžμ‹μš”μ†ŒλΌλ©΄ caption λŒ€μ‹  figcaptionμš”μ†Œλ‘œ μΊ‘μ…˜μ„ ν‘œμ‹œν•΄μ•Ό ν•œλ‹€.

5. HTML μ‹œμ‹ (Form)

form μš”μ†Œ

HTML μž…λ ₯ μ„œμ‹μ„ μ˜λ―Έν•œλ‹€

  • action 속성: μ„œμ‹μ΄ μ „μ†‘λ˜λŠ” μ„œλ²„ 파일 URL

  • metho 속성: 폼이 μ „μ†‘λ˜λŠ” 방식, get λ˜λŠ” post 값을 가진닀.

input μš”μ†Œ

λ‹€μ–‘ν•œ νƒ€μž…μ„ κ°€μ§€λŠ” μž…λ ₯ 데이터 ν•„λ“œ

Last updated