Block Elements

  • ๋ธ”๋ก ๋ ˆ๋ฒจ ์š”์†Œ๋Š” ์ž์‹ ์˜ ์ด์ „ ์š”์†Œ์™€ ์ดํ›„ ์š”์†Œ ์‚ฌ์ด์— ์ค„ ๋ฐ”๊ฟˆ

  • ํŽ˜์ด์ง€์˜ ๊ตฌ์กฐ์  ์š”์†Œ ํ‘œํ˜„์— ์œ ์šฉ

<address> : ์ „ํ™”๋ฒˆํ˜ธ, ์ด๋ฉ”์ผ ๋“ฑ ์—ฐ๋ฝ์ฒ˜ ์ •๋ณด๋ฅผ ํฌํ•จํ•˜๋Š” ์š”์†Œ

  • ์ฃผ๋กœ ์ดํƒค๋ฆญ์ฒด๋กœ ํ‘œํ˜„

  • ์‹ค์ œ ์ฃผ์†Œ, ์ด๋ฉ”์ผ ์ฃผ์†Œ, URL, ์ „ํ™”๋ฒˆํ˜ธ, ์†Œ์…œ ๋ฏธ๋””์–ด ์•„์ด๋””, ์ง€๋ฆฌ์  ์ขŒํ‘œ ๋“ฑ ๋ชจ๋“  ์œ ํ˜•์˜ ์—ฐ๋ฝ์ฒ˜ ์ •๋ณด๋ฅผ ํฌํ•จ

  • ์—ฐ๋ฝ์ฒ˜ ์ •๋ณด๋ฅผ ์ฐธ์กฐํ•˜๋Š” ์‚ฌ๋žŒ ๋˜๋Š” ์กฐ์ง์˜ ์ด๋ฆ„์ด ํฌํ•จ

  • ์ผ๋ฐ˜์ ์œผ๋กœ <footer>์•ˆ์—์„œ ์‚ฌ์šฉ๋œ๋‹ค.

<address>
  <a href="mailto:jim@rock.com">jim@rock.com</a><br>
  <a href="tel:+13115552368">(311) 555-2368</a>
  You can contact author at
  <a href="http://www.somedomain.com/contact"> www.somedomain.com</a>.<br />  
</address>

jim@rock.com (311) 555-2368 You can contact author at www.somedomain.com.\


<article>: ๋‹จ๋ฝ ์ฝ˜ํ…์ธ 

๋…๋ฆฝ์ ์œผ๋กœ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋Š” ์ปจํ…์ธ ๋กœ ๊ฒŒ์‹œํŒ์˜ ๊ธ€์ด๋‚˜ ๋‰ด์Šค ๊ธฐ์‚ฌ ๋“ฑ์˜ ์ปจํ…์ธ 

Tip:

  • <article> ํ•ญ๋ชฉ์„ ์‹๋ณ„ํ•˜๋Š”๋ฐ <h1>~<h6>์ œ๋ชฉ ์š”์†Œ๋ฅผ ์‚ฌ์šฉ

  • <article>์€ ์ค‘์ฒฉ์ด ๊ฐ€๋Šฅํ•˜๊ณ  ํ•˜์œ„ ํ•ญ๋ชฉ์€ ์ƒ์œ„ ํ•ญ๋ชฉ๊ณผ ๊ด€๋ จ์ด ์žˆ์–ด์•ผ ํ•œ๋‹ค.

  • ์ž‘์„ฑ์ž ์ •๋ณด: <address>๋ฅผ ์ด์šฉํ•ด ์ œ๊ณต

  • ์ž‘์„ฑ์ผ์ž์™€ ์‹œ๊ฐ„: <time>์š”์†Œ์˜ <time datetime="2018-07-07">์™€ ๊ฐ™์€ ์†์„ฑ ์ด์šฉํ•ด ์ œ๊ณต

<article class="film_review">
  <header>
    <h2>Jurassic Park</h2>
  </header>
  <section class="main_review">
    <p>Dinos were great!</p>
  </section>
  <section class="user_reviews">
    <article class="user_review">
      <p>Way too scary for me.</p>
      <footer>
        <p>
          Posted on <time datetime="2015-05-16 19:00">May 16</time> by Lisa.
        </p>
      </footer>
    </article>
    <article class="user_review">
      <p>I agree, dinos are my favorite.</p>
      <footer>
        <p>
          Posted on <time datetime="2015-05-17 19:00">May 17</time> by Tom.
        </p>
      </footer>
    </article>
  </section>
  <footer>
    <p>
      Posted on <time datetime="2015-05-15 19:00">May 15</time> by Staff.
    </p>
  </footer>
</article>

<aside>: ๋ถ€๊ฐ€ ์ฝ˜ํ…์ธ 

๋ฌธ์„œ์˜ ์ฃผ์š” ๋‚ด์šฉ๊ณผ ๊ฐ„์ ‘์ ์ธ ์—ฐ๊ด€ ์ปจํ…์ธ ๋ฅผ ์ œ๊ณต. ๋ถ€์—ฐ ์„ค๋ช…

์‚ฌ์ด๋“œ๋ฐ” ๋˜๋Š” ์ฝœ์•„์›ƒ ์ƒ์ž์˜ ์—ญํ• 

<article>
  <p>
    ๋””์ฆˆ๋‹ˆ ๋งŒํ™”์˜ํ™” <em>์ธ์–ด ๊ณต์ฃผ</em>๋Š”
    1989๋…„ ์ฒ˜์Œ ๊ฐœ๋ด‰ํ–ˆ์Šต๋‹ˆ๋‹ค.
  </p>
  <aside>
    ์ธ์–ด ๊ณต์ฃผ๋Š” ์ฒซ ๊ฐœ๋ด‰ ๋‹น์‹œ 8700๋งŒ๋ถˆ์˜ ํฅํ–‰์„ ๊ธฐ๋กํ–ˆ์Šต๋‹ˆ๋‹ค.
  </aside>
  <p>
    ์˜ํ™”์— ๋Œ€ํ•œ ์ •๋ณด...
  </p>
</article>

<blockquote>: ๋ธ”๋ก ์ธ์šฉ๊ตฌ

์ธ์šฉ ํ…์ŠคํŠธ๋กœ ์ด๋ฃจ์–ด์ง„ ์ธ์šฉ๊ตฌ ๋ธ”๋ก์ด๋‹ค.

  • ์ธ์šฉ๋ฌธ์˜ ์ถœ์ฒ˜๋Š” cite ์†์„ฑ ์ด์šฉํžˆ์•ผ ์ œ๊ณต

  • ์ผ๋ฐ˜์ ์œผ๋กœ ๋“ค์—ฌ์“ฐ๊ธฐ๊ฐ€ ๋˜์–ด ์žˆ๊ณ , margin-left,right๋ฅผ ํ†ตํ•ด ๋ณ€๊ฒฝ

  • ์ธ๋ผ์ธ ์ธ์šฉ๊ตฌ๋Š” <q>

<blockquote cite="https://www.huxley.net/bnw/four.html">
        <p>Words can be like X-rays, if you use them properlyโ€”theyโ€™ll go through anything. You read and youโ€™re pierced.</p>
</blockquote>

<details>: ์ƒ์„ธ ์ •๋ณด ์œ„์ ฏ

์—ด๋ฆฐ ์ƒํƒœ์ผ ๋•Œ ์ •๋ณด๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ์œ„์ ฏ

  • ๋ ˆ์ด๋ธ”์€ <summary>๋กœ ์ œ๊ณต

  • <datails>์š”์†Œ์˜ ์ฒซ ๋ฒˆ์งธ ์ž์‹์ด <summary>์š”์†Œ์ผ ๋•Œ, ์ด ์ฒซ๋ฒˆ์งธ ์š”์†Œ์˜ ์ฝ˜ํ…์ธ ๋ฅผ ์œ„์ ฏ์˜ ๋ ˆ์ด๋ธ”๋กœ ์‚ฌ์šฉ

  • ์œ„์ ฏ์˜ ๋ ˆ์ด๋ธ”์€ ์ƒ๋žต์ด ๊ฐ€๋Šฅ

  • ์•„๋ž˜์˜ ์ฝ”๋“œ์—์„œ "Details"๊ฐ€ <datails>์˜ ์œ„์ ฏ ๋ ˆ์ด๋ธ”

  • ์†์„ฑ: open

  • CSS ์ ์šฉํ•˜๊ธฐ

    • list-style ์†์„ฑ์„ ์ด์šฉ

    • ๊ธฐ๋ณธ์œผ๋กœ ๋‚˜์˜ค๋Š” ์‚ผ๊ฐํ˜• ๋ชจ์–‘ ์ œ๊ฑฐํ•˜๊ธฐ: list-style: none

<details>
    <summary>Details</summary> 
    Something small enough to escape casual notice.
</details>

toggle ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ๋ฅผ ํ†ตํ•ด open ์†์„ฑ์˜ ์ƒํƒœ ๋ณ€ํ™”๋ฅผ ๊ฐ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค.

details.addEventListener("toggle", event => {
  if (details.open) {
    /* the element was toggled open */
  } else {
    /* the element was toggled closed */
  }
});
Details

Something small enough to escape casual notice.


<dialog>: ๋Œ€ํ™”์ƒ์ž

๋‹ซ์„ ์ˆ˜ ์žˆ๊ณ , ์ƒํ˜ธ์ž‘์šฉ์ด ๊ฐ€๋Šฅํ•œ ์ปดํฌ๋„ŒํŠธ

  • ์†์„ฑ: open

    • ๋Œ€ํ™” ์ƒ์ž๊ฐ€ ํ™œ์„ฑ ์ƒํƒœ์ด๋ฉฐ ์ƒํ˜ธ์ž‘์šฉ์ด ๊ฐ€๋Šฅ.

    • open์ƒํƒœ๊ฐ€ ์•„๋‹ ๊ฒฝ์šฐ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด์—ฌ์„œ๋Š” ์•ˆ๋œ๋‹ค.

  • <dialog>์—ด ๋•Œ์—๋Š” open์†์„ฑ ์ง์ ‘ ๋ณ€๊ฒฝ์ด ์•„๋‹Œ .show(), .showModal()๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉ

<dialog open>
  <p>์—ฌ๋Ÿฌ๋ถ„ ์•ˆ๋…•ํ•˜์„ธ์š”!</p>
</dialog>

์—ฌ๋Ÿฌ๋ถ„ ์•ˆ๋…•ํ•˜์„ธ์š”!


<dl>: ์„ค๋ช… ๋ชฉ๋ก( Description List)

<dd> ์š”์†Œ์™€ <dt>์š”์†Œ๋ฅผ ํฌํ•จํ•˜๋Š” ์„ค๋ช… ๋ชฉ๋ก์„ ์ œ๊ณต

๋‹จ์–ด ์‚ฌ์ „์ด๋‚˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋“ฑ์˜ ํ‚ค-๊ฐ’ ๋ชฉ๋ก์„ ์ƒ์„ฑํ•˜๋Š”๋ฐ ์œ ์šฉ

<dt>: ์„ค๋ช… ๋ชฉ๋ก์˜ ์ •์˜ (Description Term)

ํ‚ค-๊ฐ’ ๋ชฉ๋ก์—์„œ ํ‚ค์˜ ๋ถ€๋ถ„์„ ๋‚˜ํƒ€๋‚ด๊ฑฐ๋‚˜, ๋‹จ์–ด ์‚ฌ์ „์—์„œ ๋‹จ์–ด๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๋ถ€๋ถ„์„ ํ‘œํ˜„

<dd>: ์„ค๋ช… ๋ชฉ๋ก์˜ ์ •์˜ ์„ค๋ช…(Description Details)

์šฉ์–ด <dt>์— ๋Œ€ํ•œ ์„ค๋ช…์ด๋‚˜ ์ •์˜, ๊ฐ’ ๋“ฑ์„ ์ œ๊ณต

<dl>
    <dt>Beast of Bodmin</dt>
    <dd>A large feline inhabiting Bodmin Moor.</dd>
</dl>

Beast of BodminA large feline inhabiting Bodmin Moor.


<div>: ๋ฌธ์„œ์˜ ๋ถ„ํ• 

์ˆœ์ˆ˜ํ•˜๊ฒŒ ์š”์†Œ๋ฅผ ๋‹ด๋Š” ์ปจํ…Œ์ด๋„ˆ์˜ ์—ญํ• ๋กœ ์•„๋ฌด๊ฒƒ๋„ ํ‘œํ˜„ํ•˜์ง€ ์•Š๋Š”๋‹ค.

์ด ์š”์†Œ๋Š” ๋‹ค๋ฅธ ์˜๋ฏธ๋ฅผ ๊ฐ€์ง„ ์š”์†Œ๋“ค์ด ์ ์ ˆํ•˜์ง€ ์•Š์„ ๋•Œ๋งŒ ์‚ฌ์šฉ

<div>
  <p>
    Any kind of content here. Such as &lt;p&gt;, &lt;table&gt;. You name it!
  </p>
</div>

<fieldset>: ํ•„๋“œ ์ง‘ํ•ฉ์˜ ๋ผ๋ฒจ

์›น ์–‘์‹(<form>)์—์„œ ์—ฌ๋Ÿฌ ์ปจํŠธ๋กค๊ณผ ๋ ˆ์ด๋ธ”์„ ๊ทธ๋ฃนํ™”

๊ทธ๋ฃน์— ๋Œ€ํ•œ ์„ค๋ช…: <legend>์š”์†Œ๋กœ ์ œ๊ณต

์†์„ฑ

  • form

    • ํŽ˜์ด์ง€ ๋‚ด์—์„œ <fieldset>์š”์†Œ์™€ ์—ฐ๊ฒฐํ•  <form>์š”์†Œ์˜ id

  • disabled

    • <fieldset>์š”์†Œ ๋‚ด์˜ ๋ชจ๋“  ์ฝ˜ํ…์ธ ๋ฅผ ํ•œ ๋ฒˆ์— ๋น„ํ™œ์„ฑํ™”

  • name

    • ๊ทธ๋ฃน์— ๋Œ€ํ•œ ์ด๋ฆ„

๊ธฐ๋ณธ css ์†์„ฑ

  • display: block

  • border: 2px groove

  • min-inline-size: min-content

  • ์•ฝ๊ฐ„์˜ ๋‚ด๋ถ€ ์—ฌ๋ฐฑ

<form>
  <fieldset>
    <legend>Choose your favorite monster</legend>

    <input type="radio" id="kraken" name="monster">
    <label for="kraken">Kraken</label><br/>

    <input type="radio" id="sasquatch" name="monster">
    <label for="sasquatch">Sasquatch</label><br/>

    <input type="radio" id="mothman" name="monster">
    <label for="mothman">Mothman</label>
  </fieldset>
</form>

Choose your favorite monster Kraken Sasquatch Mothman


<figure>: ๋ฏธ๋””์–ด ์ฝ˜ํ…์ธ  ๊ทธ๋ฃน๊ณผ ์„ค๋ช…

๋‹ค๋ฅธ ๋ถ€๋ถ„์œผ๋กœ ์ด๋™ํ•ด๋„ ๋ฌธ์ œ๊ฐ€ ์—†๋Š” ๋…๋ฆฝ์ ์ธ ์ปจํ…์ธ ๋ฅผ ์ œ๊ณต

์š”์†Œ ๋‚ด๋ถ€์— <figcaption>๋ฅผ ํฌํ•จํ•˜์—ฌ ์„ค๋ช…์„ ์ œ๊ณต

<figcaption>: ๊ทธ๋ฆผ ์„ค๋ช…

<figure>๊ฐ€ ํฌํ•จํ•˜๋Š” ์ปจํ…์ธ ์— ๋Œ€ํ•œ ์„ค๋ช…์ด๋‚˜ ๋ฒ”๋ก€ ์ œ๊ณต

<figure>
    <img src="/media/cc0-images/elephant-660-480.jpg"
         alt="Elephant at sunset">
    <figcaption>An elephant at sunset</figcaption>
</figure>

์ฝ”๋“œ ํ‘œํ˜„

<figure>
  <figcaption><code>navigator</code>๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ธŒ๋ผ์šฐ์ € ์ •๋ณด ์–ป๊ธฐ</figcaption>
  <pre>
function NavigatorExample() {
  var txt;
  txt = "Browser CodeName: " + navigator.appCodeName;
  txt+= "Browser Name: " + navigator.appName;
  txt+= "Browser Version: " + navigator.appVersion ;
  txt+= "Cookies Enabled: " + navigator.cookieEnabled;
  txt+= "Platform: " + navigator.platform;
  txt+= "User-agent header: " + navigator.userAgent;
}
  </pre>
</figure>
function NavigatorExample() {
  var txt;
  txt = "Browser CodeName: " + navigator.appCodeName;
  txt+= "Browser Name: " + navigator.appName;
  txt+= "Browser Version: " + navigator.appVersion ;
  txt+= "Cookies Enabled: " + navigator.cookieEnabled;
  txt+= "Platform: " + navigator.platform;
  txt+= "User-agent header: " + navigator.userAgent;
}
  

์ธ์šฉ๋ฌธ ํ‘œํ˜„

<figure>
  <figcaption><cite>Edsger Dijkstra:</cite></figcaption>
  <blockquote>If debugging is the process of removing software bugs,
  then programming must be the process of putting them in.</blockquote>
</figure>

If debugging is the process of removing software bugs, then programming must be the process of putting them in.

์‹œ ํ‘œํ˜„

<figure>
  <p style="white-space:pre">
Bid me discourse, I will enchant thine ear,
  Or like a fairy trip upon the green,
Or, like a nymph, with long dishevell'd hair,
  Dance on the sands, and yet no footing seen:
Love is a spirit all compact of fire,
  Not gross to sink, but light, and will aspire.</p>
  <figcaption><cite>Venus and Adonis</cite>,
    by William Shakespeare</figcaption>
</figure>

Bid me discourse, I will enchant thine ear, Or like a fairy trip upon the green, Or, like a nymph, with long dishevell'd hair, Dance on the sands, and yet no footing seen: Love is a spirit all compact of fire, Not gross to sink, but light, and will aspire.


๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ๊ตฌํš ์ฝ˜ํ…์ธ ๋‚˜ ๊ตฌํš ๋ฃจํŠธ์— ๋Œ€ํ•œ ํ‘ธํ„ฐ๋ฅผ ์ œ๊ณต

ํ‘ธํ„ฐ๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์ž‘์„ฑ์ž, ์ €์ž‘๊ถŒ ์ •๋ณด, ๊ด€๋ จ ๋ฌธ์„œ ๋“ฑ์— ๋Œ€ํ•œ ๋‚ด์šฉ์„ ํฌํ•จ

Tip:

  • ํ‘ธํ„ฐ์— <address>๋ฅผ ์ด์šฉํ•ด ์ž‘์„ฑ์ž ์ •๋ณด๋ฅผ ํ‘œํ˜„

  • ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ์ƒ์œ„ ์š”์†Œ๋ฅผ ๋ณธ๋ฌธ์œผ๋กœ ํ•˜์—ฌ ์ „์ฒด ํŽ˜์ด์ง€์— ์ ์šฉ

  • <footer>๋Š” ์ปจํ…์ธ ๋ฅผ ์„น์…˜ํ™”ํ•˜์ง€ ํ•˜์ง€ ์•Š์•„ ๊ฐœ์š”์— ๋‚˜ํƒ€๋‚˜์ง€ ์•Š๋Š”๋‹ค.

<footer>
  Some copyright info or perhaps some author info for an &lt;article&gt;?
</footer>

<form>: ์ž…๋ ฅ ํผ

๋Œ€ํ™”ํ˜• ์ปจํŠธ๋กค์„ ์ œ๊ณต

CSS ์˜์‚ฌ ํด๋ž˜์Šค :valid, :invalid๋ฅผ ํ†ตํ•ด ์–‘์‹์ด ์œ ํšจํ•œ ๊ฒฝ์šฐ์— ๋Œ€ํ•œ CSS ์†์„ฑ ์ ์šฉ ๊ฐ€๋Šฅ

์†์„ฑ

  • accept-charset

    • ์„œ๋ฒ„๊ฐ€ ํ—ˆ์šฉํ•˜๋Š” ๋ฌธ์ž ์ธ์ฝ”๋”ฉ ๋ชฉ๋ก

    • ๊ธฐ๋ณธ๊ฐ’์€ ํŽ˜์ด์ง€ ์ธ์ฝ”๋”ฉ

  • action

    • ์–‘์‹ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•  ํ”„๋กœ๊ทธ๋žจ์˜ URI

    • <button>, <input type="submit">, <input type="image">์š”์†Œ์˜ formaction ์†์„ฑ์œผ๋กœ ์žฌ์ •์˜ ๊ฐ€๋Šฅ

  • autocapitalize

    • ์˜๋ฌธ์— ๋Œ€ํ•œ ๋Œ€์†Œ๋ฌธ์ž ์ž๋™ ๋ณ€ํ™˜ ๋ฐฉ์‹

    • ios safari์—์„œ๋งŒ ์‚ฌ์šฉํ•˜๋Š” ๋น„ํ‘œ์ค€ ํŠน์„ฑ

  • autocomplete

    • ์ž…๋ ฅ ์š”์†Œ์˜ ์ž๋™์™„์„ฑ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ• ์ง€

    • off: ์ž๋™์™„์„ฑ x

    • on: ์ž๋™์™„์„ฑ o

  • entype

    • method ์†์„ฑ์ด post ๊ฐ’์ผ ๋•Œ, ์–‘์‹ ์ œ์ถœ์‹œ MIME ์œ ํ˜• ์ง€์ •

    • ๊ธฐ๋ณธ๊ฐ’: application/x-www-form-urlencoded

    • multipart/form-data: <input type="file">์ด ์กด์žฌ ํ•˜๋Š” ๊ฒฝ์šฐ ์‚ฌ์šฉ

    • text/plain: html 5์—์„œ ๋””๋ฒ„๊น…์šฉ

  • method

    • ์–‘์‹ ์ œ์ถœ์‹œ ์‚ฌ์šฉํ•  HTTP ๋ฉ”์„œ๋“œ

    • post: ์–‘์‹ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณธ๋ฌธ์ธ body์— ๋„ฃ์–ด ์ „์†ก

    • get: ์–‘์‹ ๋ฐ์ดํ„ฐ๋ฅผ url๊ณผ ? ๊ตฌ๋ถ„์ž ๋’ค์— ์ด์–ด ๋ถ™์—ฌ ์ „์†ก

    • dialog: ์–‘์‹์ด <dialog> ์•ˆ์— ์œ„์น˜ํ•  ๊ฒฝ์šฐ, ์ œ์ถœ๊ณผ ํ•จ๊ป˜ ๋Œ€ํ™” ์ƒ์ž ์ข…๋ฃŒ

  • name

    • form์˜ ์˜ ์ด๋ฆ„

  • novalidate

    • ์ง€์ •ํ•  ๊ฒฝ์šฐ ์–‘์‹์˜ ์œ ํšจ์„ฑ ๊ฒ€์ฆ ๊ฑด๋„ˆ ๋›ฐ๊ธฐ

  • target

    • ์–‘์‹ ์ œ์ถœ์— ๋Œ€ํ•œ ๊ฒฐ๊ณผ๋ฅผ ํ‘œ์‹œํ•  ์œ„์น˜๋ฅผ ์ง€์ •

    • ๊ฐ€๋Šฅํ•œ ๊ฐ’: ๋ธŒ๋ผ์šฐ์ง• ๋งฅ๋ฝ์˜ ์ด๋ฆ„ ๋˜๋Š” ํ‚ค์›Œ๋“œ

    • _self: ์‘๋‹ต์„ ํ˜„์žฌ ๋ธŒ๋ผ์šฐ์ง• ๋งฅ๋ฝ์— ํ‘œ์‹œ. ๊ธฐ๋ณธ๊ฐ’

    • _blank: ์‘๋‹ต์„ ์ƒˆ๋กœ์šด ๋ธŒ๋ผ์šฐ์ง• ๋งฅ๋ฝ์— ํ‘œ์‹œ. ๋ณดํ†ต ์ƒˆ ํƒญ

    • _parent: ์‘๋‹ต์„ ํ˜„์žฌ ๋ธŒ๋ผ์šฐ์ง• ๋งฅ๋ฝ์˜ ๋ถ€๋ชจ์— ํ‘œ์‹œ. ๋ถ€๋ชจ๊ฐ€ ์—†์œผ๋ฉด _self์™€ ๋™์ผํ•˜๊ฒŒ ๋™์ž‘

    • _top: ์‘๋‹ต์„ ์ตœ์ƒ๋‹จ ๋ธŒ๋ผ์šฐ์ง• ๋งฅ๋ฝ์— ํ‘œ์‹œ. ๋ถ€๋ชจ๊ฐ€ ์—†์œผ๋ฉด _self์™€ ๋™์ผํ•˜๊ฒŒ ๋™์ž‘

<form action="" method="get" class="form-example">
  <div class="form-example">
    <label for="name">Enter your name: </label>
    <input type="text" name="name" id="name" required>
  </div>
  <div class="form-example">
    <label for="email">Enter your email: </label>
    <input type="email" name="email" id="email" required>
  </div>
  <div class="form-example">
    <input type="submit" value="Subscribe!">
  </div>
</form>

Enter your name: Enter your email:


<h1>~<h6>: ์ œ๋ชฉ

6๋‹จ๊ณ„๋กœ ์ด๋ฃจ์–ด์ง„ ๊ตฌํš ์ œ๋ชฉ์„ ์ œ๊ณต

Tips:

  • ๊ธ€์”จ ํฌ๊ธฐ ์กฐ์ •์€ hํƒœ๊ทธ๊ฐ€ ์•„๋‹Œ css์˜ font-size ์ด์šฉ

  • ์ œ๋ชฉ ๋‹จ๊ณ„๋Š” h1๋ถ€ํ„ฐ h2, h3 ์ˆœ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ์ง€ ์•Š๊ณ  ์ˆœ์ฐจ์ ์œผ๋กœ ์‚ฌ์šฉ

  • ํŽ˜์ด์ง€๋‹น ํ•˜๋‚˜์˜ h1 ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉ

<header>: ํŽ˜์ด์ง€๋‚˜ ๊ตฌ์—ญ์˜ ํ—ค๋”

์†Œ๊ฐœ ๋ฐ ํƒ์ƒ‰์— ๊ด€๋ จ๋œ ์ฝ˜ํ…์ธ  ์ œ๊ณต

์ œ๋ชฉ์ด๋‚˜ ๋กœ๊ณ , ๊ฒ€์ƒ‰ ์ฐฝ, ์ž‘์„ฑ์ž ์ด๋ฆ„๋“ฑ์˜ ์š”์†Œ๋ฅผ ํฌํ•จ

<header class="page-header">
    <h1>Cute Puppies Express!</h1>
</header>

<main>
    <p>I love beagles <em>so</em> much! Like, really, a lot. Theyโ€™re adorable and their ears are so, so snuggly soft!</p>
</main>

<hgroup>: ํ—ค๋” ์ •๋ณด ๊ทธ๋ฃน

์ œ๋ชฉ, ๋ถ€์ œ๋ชฉ๊ณผ ๊ฐ™์ด ๋ฌธ์„œ ๊ตฌํš์˜ ๋‹ค๋‹จ๊ณ„ ์ œ๋ชฉ์„ ํ‘œํ˜„

h1~h6 ํƒœ๊ทธ ์—ฌ๋Ÿฌ ๊ฐœ๋ฅผ ๋ฌถ์„ ๋•Œ ์‚ฌ์šฉ

<hgroup>
  <h1>์ฃผ์š” ์ œ๋ชฉ</h1>
  <h2>๋ถ€์ œ๋ชฉ</h2>
</hgroup>

<hr>: ์ˆ˜ํ‰์„ 

์ฃผ์ œ๋ฅผ ๋ถ„๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ์ˆ˜ํ‰์„ 

<li>: ๋ชฉ๋ก์˜ ํ•ญ๋ชฉ

๋ชฉ๋ก์—์„œ ํ•ญ๋ชฉ์„ ๋‚˜ํƒ€๋‚ด๋ฏ€๋กœ <ol>์ด๋‚˜ <ul>,<menu>์•ˆ์— ์œ„์น˜

์†์„ฑ

  • value

    • ์š”์†Œ ๋‚ด๋ถ€์—์„œ ํ•ญ๋ชฉ์˜ ํ˜„์žฌ ์„œ์ˆ˜ ๊ฐ’์„ ๋‚˜ํƒ€๋‚ด๋Š” ์ •์ˆ˜

    • ๋น„์ •๋ ฌ ๋ชฉ๋ก<ul>๊ณผ <menu>์—์„œ๋Š” ์˜๋ฏธ๊ฐ€ ์—†๋‹ค

  • type

    • ๋„˜๋ฒ„๋ง ํƒ€์ž…์„ ๋‚˜ํƒ€๋‚ด๋Š” ๋ฌธ์ž

    • ํ˜„์žฌ๋Š” css์˜ list-style-type ์†์„ฑ์„ ์ด์šฉ

    • a: ์†Œ๋ฌธ์ž ๊ธ€์ž

    • A: ๋Œ€๋ฌธ์ž ๊ธ€์ž

    • i: ์†Œ๋ฌธ์ž ๋กœ๋งˆ ์ˆซ์ž

    • I: ๋Œ€๋ฌธ์ž ๋กœ๋งˆ ์ˆซ์ž

    • 1: ์ˆซ์ž

<ol type="I">
    <li value="3">third item</li>
    <li>fourth item</li>
    <li>fifth item</li>
</ol>
  1. third item

  2. fourth item

  3. fifth item

<main>: ๋ฌธ์„œ์—์„œ ํ•˜๋‚˜๋ฟ์ธ ์ค‘์‹ฌ ์ฝ˜ํ…์ธ 

์ด ์š”์†Œ์˜ ์ฝ˜ํ…์ธ ๋Š” ๋ฌธ์„œ์—์„œ ์œ ์ผํ•œ ๋‚ด์šฉ์ด์–ด์•ผ ํ•œ๋‹ค.

๋ฌธ์„œ์—๋Š” ํ•˜๋‚˜์˜ <main> ์š”์†Œ๋งŒ ์กด์žฌํ•ด์•ผ ํ•œ๋‹ค

<main>์š”์†Œ์— id์š”์†Œ๋ฅผ ์ถ”๊ฐ€ํ•ด ๊ฑด๋„ˆ๋›ฐ๊ธฐ ๋งํฌ์˜ ๋Œ€์ƒ์œผ๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

<body>
  <a href="#main-content">Skip to main content</a>

  <!-- navigation and header content -->

  <main id="main-content">
    <!-- main page content -->
  </main>
</body>

<nav>: ํƒ์ƒ‰๋งํฌ๋ฅผ ํฌํ•จํ•˜๋Š” ๋„ค๋น„๊ฒŒ์ดํ„ฐ

๋ฉ”๋‰ด, ๋ชฉ์ฐจ, ์ƒ‰์ธ ๋“ฑ์— ์‚ฌ์šฉ

<nav class="crumbs">
    <ol>
        <li class="crumb"><a href="#">Bikes</a></li>
        <li class="crumb"><a href="#">BMX</a></li>
        <li class="crumb">Jump Bike 3000</li>
    </ol>
</nav>

<h1>Jump Bike 3000</h1>
<p>This BMX bike is a solid step into the pro world. It looks as legit as it rides and is built to polish your skills.</p>

Tips:

  • ๋ชจ๋“  ๋งํฌ๊ฐ€ <nav>์š”์†Œ ์•ˆ์— ์žˆ์„ ํ•„์š”๋Š” ์—†๋‹ค.

  • ์ฃผ์š” ํƒ์ƒ‰ ๋งํฌ๋ฅผ ์œ„ํ•œ ์š”์†Œ์ด๋‹ค.

  • ์ค‘์š”ํ•˜์ง€ ์•Š์€ ๋งํฌ๋Š” <footer>์— ์ •์˜ ํ•  ์ˆ˜ ์žˆ๋‹ค.

  • ํ•˜๋‚˜์˜ ํŽ˜์ด์ง€ ๋‚ด์—์„œ ์—ฌ๋Ÿฌ ๊ฐœ์˜ <nav>๋ฅผ ์‚ฌ์šฉ ๊ฐ€๋Šฅ. ์ „์ฒด ํƒ์ƒ‰์šฉ ๊ทธ๋ฆฌ๊ณ  ํ˜„์žฌ ํŽ˜์ด์ง€ ํƒ์ƒ‰ ๋“ฑ ์ด๋•Œ aria-labelledby๋ฅผ ์‚ฌ์šฉ

<ol>: ์ •๋ ฌ๋œ(์ˆœ์„œ์žˆ๋Š”) ๋ชฉ๋ก

์ˆœ์„œ๊ฐ€ ์ง€์ •๋œ ๋ชฉ๋ก์„ ์ œ๊ณต

<ol start="4">
  <li>Speedwalk Stu</li>
  <li>Saunterinโ€™ Sam</li>
  <li>Slowpoke Rodriguez</li>
</ol>

์†์„ฑ

  • resversed

    • ๋ชฉ๋ก์˜ ํ•ญ๋ชฉ์ด ์—ญ์ˆœ์ž„์„ ์ง€์ •

  • start

    • ๋ชฉ๋ก ํ•ญ๋ชฉ์—์„œ ์‹œ์ž‘ํ•  ์ˆ˜

  • type

    • ๋ฒˆํ˜ธ ๋งค๊ธฐ๊ธฐ ์œ ํ˜•

    • a: ์†Œ๋ฌธ์ž ๊ธ€์ž

    • A: ๋Œ€๋ฌธ์ž ๊ธ€์ž

    • i: ์†Œ๋ฌธ์ž ๋กœ๋งˆ ์ˆซ์ž

    • I: ๋Œ€๋ฌธ์ž ๋กœ๋งˆ ์ˆซ์ž

    • 1: ์ˆซ์ž

<p>: ๋ฌธ๋‹จ

ํ•˜๋‚˜์˜ ๋ฌธ๋‹จ์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋ฌธ๋‹จ์€ ๋ธ”๋ก ๋ ˆ๋ฒจ ์š”์†Œ

<p>Geckos are a group of usually small, usually nocturnal lizards. They are found on every continent except Australia.</p>

<pre>: ๋ฏธ๋ฆฌ ์„œ์‹ ์ ์šฉํ•œ ๊ธ€

๋ฏธ๋ฆฌ ์„œ์‹์ด ์ง€์ •๋œ ํ…์ŠคํŠธ๋กœ, HTML์— ๋‚ด์šฉ์„ ๊ทธ๋Œ€๋กœ ํ‘œํ˜„

ํ…์ŠคํŠธ๋Š” ๋ณดํ†ต ๊ณ ์ •ํญ ๊ธ€๊ผด์„ ์‚ฌ์šฉํ•ด ๋ Œ๋”๋ง, ์š”์†Œ๋‚ด ๊ณต๋ฐฑ๋ฌธ์ž๋ฅผ ๊ทธ๋Œ€๋กœ ์œ ์ง€

<pre>
  L          TE
    A       A
      C    V
       R A
       DOU
       LOU
      REUSE
      QUE TU
      PORTES
    ET QUI T'
    ORNE O CI
     VILISร‰
    OTE-  TU VEUX
     LA    BIEN
    SI      RESPI
            RER       - Apollinaire
</pre>

์ ‘๊ทผ์„ฑ

  • ๋ฌธ์ž๋ฅผ ๊ทธ๋ฆผ์ด๋‚˜ ๋„ํ‘œ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜๋ฉด ์ฐจ๋ก€๋Œ€๋กœ ์ฝ๋Š” ์Šคํฌ๋ฆฐ ๋ฆฌ๋”๊ธฐ๋กœ๋Š” ์ดํ•ดํ•˜์ง€ ๋ชปํ•œ๋‹ค.

  • ์ด ๋•Œ๋Š” <figure>์™€ <figcaption>์„ ์ด์šฉํ•ด ๋Œ€์ฒด ์„ค๋ช…์„ ์ž‘์„ฑ

<figure role="img" aria-labelledby="cow-caption">
  <pre>
  _______________________
< ๋‚˜๋Š” ์ด ๋ถ„์•ผ์˜ ์ „๋ฌธ๊ฐ€๋‹ค. >
  -----------------------
         \   ^__^
          \  (oo)\_______
             (__)\       )\/\
                 ||----w |
                 ||     ||
  </pre>
  <figcaption id="cow-caption">
    ์†Œ ํ•œ ๋งˆ๋ฆฌ๊ฐ€ "๋‚˜๋Š” ์ด ๋ถ„์•ผ์˜ ์ „๋ฌธ๊ฐ€๋‹ค"๋ผ๊ณ  ๋งํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์†Œ๋Š” ๋ฏธ๋ฆฌ ์„œ์‹์„ ์ ์šฉํ•œ ํ…์ŠคํŠธ๋กœ ๊ทธ๋ ค์ ธ์žˆ์Šต๋‹ˆ๋‹ค.
  </figcaption>
</figure>

<section>: ์›น ํŽ˜์ด์ง€์˜ ๊ตฌ์—ญ

๋ฌธ์„œ์—์„œ ๋…๋ฆฝ์ ์ธ ๊ตฌํš์ด๋ฉฐ ๋ณดํ†ต ์ œ๋ชฉ์„ ํฌํ•จ

<h1>Choosing an Apple</h1>
<section>
    <h2>Introduction</h2>
    <p>This document provides a guide to help with the important task of choosing the correct Apple.</p>
</section>

Tips:

๊ฐ๊ฐ์˜ <section>์„ ๊ตฌ๋ถ„ํ•  ์ˆ˜๋‹จ์ด ํ•„์š”. ์ฃผ๋กœ ์ œ๋ชฉ ํƒœ๊ทธ๋ฅผ ํฌํ•จ์‹œํ‚ค๋Š” ๋ฐฉ๋ฒ• ์ด์šฉ

์š”์†Œ์˜ ์ฝ˜ํ…์ธ ๋ฅผ ๋”ฐ๋กœ ๊ตฌ๋ถ„์ด ํ•„์š”ํ•  ๊ฒฝ์šฐ์—๋Š” <article> ์š”์†Œ๋ฅผ ๊ณ ๋ ค

<table>: ํ‘œ

  • <tr>: ํ–‰ ๊ตฌ๋ถ„

  • <th>: ์…€ ์ œ๋ชฉ

  • <td>: ์…€

์ ‘๊ทผ์„ฑ

  • <caption>์š”์†Œ๋ฅผ ์ œ๊ณตํ•˜์—ฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ์„ค๋ช… ์ œ๊ณตํ•˜์—ฌ ๋ถˆํ•„์š”ํ•œ ๊ฒฝ์šฐ ์Šคํ‚ตํ•˜๋„๋ก ๋„์›€

<table>
  <caption>Color names and values</caption>
  <tbody>
    <tr>
      <th scope="col">Name</th>
      <th scope="col">HEX</th>
      <th scope="col">HSLa</th>
      <th scope="col">RGBa</th>
    </tr>
    <tr>
      <th scope="row">Teal</th>
      <td><code>#51F6F6</code></td>
      <td><code>hsla(180, 90%, 64%, 1)</code></td>
      <td><code>rgba(81, 246, 246, 1)</code></td>
    </tr>
    <tr>
      <th scope="row">Goldenrod</th>
      <td><code>#F6BC57</code></td>
      <td><code>hsla(38, 90%, 65%, 1)</code></td>
      <td><code>rgba(246, 188, 87, 1)</code></td>
    </tr>
  </tbody>
</table>

<ul>: ์ •๋ ฌ๋˜์ง€ ์•Š์€ ๋ชฉ๋ก

๋ณดํ†ต ๋ถˆ๋ฆฟ์œผ๋กœ ํ‘œํ˜„๋˜๋Š” ์ •๋ ฌ๋˜์ง€ ์•Š์€ ๋ชฉ๋ก

<ul>
  <li>first item</li>
  <li>second item</li>
  <li>third item</li>
</ul>

๋‘ ์š”์†Œ์˜ ์ฐจ์ด์ 

  • ์ฝ˜ํ…์ธ  ๋ชจ๋ธ: ๋ธ”๋ก ์š”์†Œ๋Š” ์ธ๋ผ์ธ ์š”์†Œ ํ˜น์€ ๋‹ค๋ฅธ ๋ธ”๋ก ์š”์†Œ๋ฅผ ํฌํ•จํ•  ์ˆ˜ ์žˆ๋‹ค

  • ๊ธฐ๋ณธ ์„œ์‹: ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ธ”๋ก ์š”์†Œ๋Š” ์ƒˆ๋กœ์šด ์ค„์—์„œ ์‹œ์ž‘, ์ธ๋ผ์ธ ์š”์†Œ๋Š” ์ค„์˜ ์–ด๋Š ๊ณณ์—์„œ๋“  ์‹œ์ž‘ ํ•  ์ˆ˜ ์žˆ๋‹ค.

๋ธ”๋ก๊ณผ ์ธ๋ผ์ธ์˜ ์˜๋ฏธ๋Š” css์˜ box model๊ณผ ์œ ์‚ฌํ•˜์ง€๋งŒ ๋‹ค๋ฅด๋‹ค

Last updated