[TUE] 2021-11-09 TIL

MINBOKยท2021๋…„ 11์›” 9์ผ
1

๋ฉ‹์Ÿ์ด์‚ฌ์ž์ฒ˜๋Ÿผ

๋ชฉ๋ก ๋ณด๊ธฐ
2/19
post-custom-banner

์ด์ œ ์กธ์—…์ „์‹œ๊ฐ€ ๋๋‚ฌ๋‹ค!
๋งจ๋‚  "์•„ ์ง‘์— ๊ฐ€๊ณ ์‹ถ๋‹ค~ ์žํ‡ดํ•˜๊ณ ์‹ถ๋‹ค~"๋ฅผ ์ž…์— ๋‹ฌ๊ณ ์‚ด์•˜์—ˆ๋Š”๋ฐ,
๋ง‰์ƒ ์กธ์—…์„ ์•ž๋‘๋‹ˆ ์‹ฑ์ˆญ์ƒ์ˆญํ•˜๋‹ค.
์กธ์—…ํ•˜๊ธฐ์‹ซ๋‹ค. ๋‚˜ ๊ทธ๋ƒฅ ํ‰์ƒ ํ•™์ƒ ์‹œ์ผœ์ฃผ์„ธ์š”๐Ÿ˜ข

์ง€๋‚œ์ฃผ๋Š” ์กธ์—…์ „์‹œ๋•Œ๋ฌธ์— ๋ฉ‹์‚ฌ ์ˆ˜์—…์„ ๋งŽ์ด ๋น ์กŒ๋‹ค.
๊ทธ๋ž˜์„œ ๊ทธ๋Ÿฐ์ง€ ์ˆ˜์—…์ง„๋„๋ฅผ ๋”ฐ๋ผ๊ฐ€๊ธฐ๊ฐ€ ์–ด๋ ต๋‹ค. ํ‘ํ‘
์ด์ œ ์ „์‹œ๋„ ๋๋‚ฌ์œผ๋‹ˆ velog์—…๋กœ๋“œ๋„ ์—ด์‹ฌํžˆ ํ•˜๊ณ 
์ˆ˜์—…๋„ ์—ด์‹ฌํžˆ ๋“ค์–ด์•ผ๊ฒ ๋‹ค.๐Ÿ˜ฅ

์ง„๋„๋ฅผ ๋”ฐ๋ผ๊ฐ€๊ธฐ๊ฐ€ ๋ฒ…์ฐจ์„œ ํ˜ผ์ž ๊ฐ•์˜ ๊ต์•ˆ์„ ๋ณด๋ฉด์„œ
๊ณต๋ถ€ํ•ด๋ดค๋‹ค.
์•„๋ž˜์—๋Š” ๊ณต๋ถ€ํ•˜๋ฉฐ ๋ฐฐ์šด์ ์„ ์ •๋ฆฌํ•  ์˜ˆ์ •์ด๋‹ค.

#1 HTML

๐Ÿ”ท ๊ธ€์žํƒœ๊ทธ

<h1> ~ <h6> : ๊ธ€์žํฌ๊ธฐ ์กฐ์ ˆ์ด๋‚˜ bold๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉํ•˜์ง€์•Š์Œ
              ์ค‘์š”๋„์— ๋”ฐ๋ผ ์‚ฌ์šฉ๋Œ
<b>ํƒœ๊ทธ : ๊ตต์€ ๊ธ€๊ผด์„ ํ‘œํ˜„ํ• ๋•Œ ์‚ฌ์šฉ
<strong> : ๊ตต์€ ๊ธ€๊ผด + ์ค‘์š”๋„
<wbr>: ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ํ•ด๋‹น ๋‹จ์–ด๋ฅผ ์ž˜๋ชป๋œ ์œ„์น˜์—์„œ ํ–‰๋ฐ”๊ฟˆํ•˜์ง€ ์•Š๋„๋ก 
       <wbr> ์š”์†Œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ–‰๋ฐ”๊ฟˆ๋  ์ˆ˜ ์žˆ๋Š” ์œ„์น˜๋ฅผ ์ง์ ‘ ๋ช…์‹œ
<i> : italic
<em> : italic + ๊ฐ•์กฐ์˜ ์˜๋ฏธ
<mark> : ํ•˜์ด๋ผ์ดํŠธ ํ‘œ์‹œ
<abbr> : ์ค„์ž„๋ง์ด๋‚˜ ์•ฝ์ž ํ‘œํ˜„
<sup> : ์œ—์ฒจ์ž ex) H2O (๋ฌผ)
<sub> : ์•„๋žซ์ฒจ์ž ex) X2=4 (X์ œ๊ณฑ์€ 4)
<blockquote> : ์ธ์šฉ ๋ธ”๋Ÿญ
<q> : ์ธ์šฉ๊ตฌ
<cite> : The <cite> tag defines the title of a creative work 
         (e.g. a book, a poem, a song, a movie, a painting, 
               a sculpture, etc.).
        - Note: A person's name is not the title of a work.
        - The text in the <cite> element usually renders 
          in italic.

๐Ÿ”ท ์ฝ˜ํ…์ธ  ๊ทธ๋ฃน ํƒœ๊ทธ

<dl> : ์ •์˜ ๋ชฉ๋ก(definition list)
<dt> : ์ •์˜ํ•  ์šฉ์–ด(definition term)
<dd>: ์šฉ์–ด๋ฅผ ์„ค๋ช…(definition description)

<dl>
    <dt>ํ˜ธ๋‘</dt>
    <dd>์šฐ๋ฆฌ์ง‘ ๊ณ ์–‘์ด ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.</dd>
</dl>

Use a <figure> element to mark up a photo in a document, 
and a <figcaption> element to define a caption for the photo

<figure>
	<img src="image/cat.jpg" alt="๊ณ ์–‘์ด">
	<figcaption>
		๊ท€์—ฌ์šด ๊ณ ์–‘์ด ์‚ฌ์ง„
	</figcaption>
</figure>

๐Ÿ”ท ํผ ํƒœ๊ทธ

  1. Form์ด๋ž€?
    : ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•˜๋Š” ์˜์—ญ ex) ๋กœ๊ทธ์ธ์ฐฝ, ํšŒ์›์ •๋ณด ๊ธฐ์ž…์ฐฝ ๋“ฑ
  2. Form ๋™์ž‘ ๋ฐฉ์‹
    : ๋ธŒ๋ผ์šฐ์ €์—์„œ ๋ฐ์ดํ„ฐ ์ž…๋ ฅ ๋ฐœ์ƒ -> ์›น ์„œ๋ฒ„๋กœ ๋ฐ์ดํ„ฐ ์ด๋™ -> ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ์œ„ํ•ด ์›น ์„œ๋ฒ„๊ฐ€ APPํ˜ธ์ถœ
    -> ๋ฐ์ดํ„ฐ๋ฅผ DB๋กœ ์ „์†ก(CRUD) -> APP -> WEB -> ํด๋ผ์ด์–ธํŠธ ๋ธŒ๋ผ์šฐ์ € -> ์‚ฌ์šฉ์ž ๋ธŒ๋ผ์šฐ์ €

*์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ๊ด€๋ จํ•ด์„œ๋Š” ์œ ํŠœ๋ธŒ ์ƒํ™œ์ฝ”๋”ฉ
WEB1 - 17. ์ธํ„ฐ๋„ท์„ ์—ฌ๋Š” ์—ด์‡  : ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ
๊ฐ•์˜๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค.

  1. Form ์†์„ฑ
  • action : ์ž…๋ ฅ๊ฐ’์„ ์ „์†กํ•  ํŽ˜์ด์ง€
  • method : ๋ฐ์ดํ„ฐ ์ „์†ก๋ฐฉ์‹ ์ง€์ •
    1. get : ์ฃผ์†Œ์— ๋ฐ์ดํ„ฐ๊ฐ€ ํฌํ•จ๋Œ
    2. post : ๋ณด์•ˆ์ด ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ, ์ฃผ์†Œ์— ๋ฐ์ดํ„ฐ ํฌํ•จ X
ex) <form action="" method="get" class=""></form>
  1. Form type
  • text : text ์ž…๋ ฅ
  • password : ๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ (โšซโšซโšซโšซโšซ)
  • textarea : ์—ฌ๋Ÿฌ์ค„์˜ text
  • search : ๊ฒ€์ƒ‰ ์ฐฝ
  • date : ๋‚ ์งœ
  • time : ์‹œ๊ฐ„ ์ž…๋ ฅ
  • range : ๋ฒ”์œ„, ์Šฌ๋ผ์ด๋“œ ๋ฐ” ํ˜•์‹
  • number : ์ˆซ์ž ์„ ํƒ
  • color : ์ƒ‰ ์„ ํƒ
  • radio : ๋ผ๋””์˜ค ๋ฒ„ํŠผ (ํƒ์ผ)
    / radio ๋ฒ„ํŠผ์˜ name์ด ๊ฐ™์•„์•ผ ํ•˜๋‚˜๋งŒ ์„ ํƒ๋˜๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Œ
  • checkbox : ์ฒดํฌ๋ฐ•์Šค (๋‹ค์ค‘์„ ํƒ ๊ฐ€๋Šฅ)
  • file : ํŒŒ์ผ ์—…๋กœ๋“œ
  • email : ์ด๋ฉ”์ผ ์ฃผ์†Œ ์ž…๋ ฅ
  • url : ์›น ์ฃผ์†Œ ์ž…๋ ฅ
  • tel : ์ „ํ™”๋ฒˆํ˜ธ ์ž…๋ ฅ
โœจ<legend> : ํ•ญ์ƒ <fieldset> ํƒœ๊ทธ ๋ฐ”๋กœ ๋’ค์— ์œ„์น˜, 
           ํผ ๊ทธ๋ฃน์˜ ๋ชฉ์ ์„ ๋ช…์‹œํ•˜๋Š” ์ œ๋ชฉ

The <form> tag is used to create an HTML form for user input.

The <form> element can contain one 
or more of the following form elements:

โœจ<input> : ์‚ฌ์šฉ์ž์—๊ฒŒ ์ •๋ณด๋ฅผ ์ž…๋ ฅ๋ฐ›๋Š” ๊ณต๊ฐ„
<textarea> : ์—ฌ๋Ÿฌ์ค„์˜ text๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๋Š” ๊ณต๊ฐ„
<button> : ๋ฒ„ํŠผ (type: submit/reset/button)
<select> : ๋“œ๋กญ๋‹ค์šด ๋ฆฌ์ŠคํŠธ ๋ฐ•์Šค ์ƒ์„ฑ
<option> : <select>ํƒœ๊ทธ ๋‚ด๋ถ€์—์„œ ์‚ฌ์šฉ, value์™€ selected ์†์„ฑ ๊ฐ€์ง
           (value : ์„œ๋ฒ„์— ์–ด๋–ค ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•  ๊ฒƒ์ธ๊ฐ€
            selected : ํŽ˜์ด์ง€ ๋กœ๋“œ์‹œ ๊ธฐ๋ณธ์œผ๋กœ ์„ ํƒ๋˜๋Š” ์˜ต์…˜ )
<optgroup> : ๋“œ๋กญ๋‹ค์šด ๋ฆฌ์ŠคํŠธ ๋ฐ•์Šค๋‚ด ๊ด€๊ณ„์žˆ๋Š” ์˜ต์…˜๋“ค๋ผ๋ฆฌ ๋ฌถ์–ด์คŒ
<fieldset> : ์ž์‹ ํผ ์ปจํŠธ๋กค ๊ทธ๋ฃนํ™”
<label> : ํƒœ๊ทธ๋ฅผ ์„ค๋ช…ํ•˜๋Š” ํ…์ŠคํŠธ // ์‹œ๊ฐ์žฅ์• ์ธ๋“ค์˜ ํŽธ์˜๋ฅผ ์œ„ํ•ด ํ•„์š”ํ•จ
<output> : ์‚ฌ์šฉ์ž ํ–‰๋™์˜ ๊ฒฐ๊ณผ๋ฅผ ์‚ฝ์ž…

โœจ input

  • type
  • name : ํƒœ๊ทธ ์ด๋ฆ„ ์ง€์ •
  • readonly : ์ฝ๊ธฐ ์ „์šฉ
  • maxlength : ์ตœ๋Œ€ ๊ธ€์ž ์ˆ˜
  • required : ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’
  • autofocus : ์›น ๋กœ๋”ฉ์‹œ ์˜คํ†  ํฌ์ปค์Šค
  • placeholder : ์ž…๋ ฅ๊ฐ’์— ๋Œ€ํ•œ ํžŒํŠธ
  • pattern : ํŠน์ • ๋ฒ”์œ„๋‚ด์˜ ์œ ํšจ๊ฐ’

โœจ label

<label for="Name">์ด๋ฆ„ : </label>
<input type="text" name="name" id="Name">

ํผ ํƒ€์ž…์˜ id๊ฐ’๊ณผ ๋ ˆ์ด๋ธ”์˜ for ์†์„ฑ์˜ ๊ฐ’์€ ๋™์ผํ•ด์•ผํ•œ๋‹ค.

๐Ÿ”ท ํ…Œ์ด๋ธ” ํƒœ๊ทธ

JS๋‚˜ CSS ์ ์šฉ์„ ์œ„ํ•ด ํ…Œ์ด๋ธ”์— <thead>, <tbody>, <tfoot>๋ฅผ
์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค. ๊ตฌ๋„ ์žก๋Š”์šฉX
<caption> : ํ…Œ์ด๋ธ” ์ƒ๋‹จ ์ œ๋ชฉ
<colgroup> : /*์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ•˜๋Š”์ง€ ๋ชจ๋ฅด๊ฒ ๋‹ค๐Ÿ˜“*/

**The <colgroup> HTML element defines 
   a group of columns within a table.

 <caption>Superheros and sidekicks</caption>
    <colgroup>
        <col>
        <col span="2" class="batman">
        <col span="2" class="flash">
    </colgroup>


**<th>๋‚ด๋ถ€์— scope ์†์„ฑ๊ณผ ์‚ฌ์šฉ
<row> : ํ–‰์— ๋Œ€ํ•œ ๋จธ๋ฆฟ๋ง
<col> : ์—ด์— ๋Œ€ํ•œ ๋จธ๋ฆฟ๋ง

<table>
    <tr>
        <td> </td>
        <th scope="col">Batman</th>
        <th scope="col">Robin</th>
        <th scope="col">The Flash</th>
        <th scope="col">Kid Flash</th>
    </tr>
    <tr>
        <th scope="row">Skill</th>
        <td>Smarts</td>
        <td>Dex, acrobat</td>
        <td>Super speed</td>
        <td>Super speed</td>
    </tr>
</table>
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€