🦁_21.11.03 TIL

BoriΒ·2021λ…„ 11μ›” 4일
2
post-thumbnail

21λ…„ 11μ›” 03일

πŸ“Ž HTML

폼 νƒœκ·Έ 보좩

  • <output> : The <output> HTML element is a container element into which a site or app can inject the results of calculation or the outcome of a user action.
    => <output> νƒœκ·ΈλŠ” μ‚¬μ΄νŠΈ/앱이 κ³„μ‚°ν•œ κ²°κ³Όλ‚˜ μ‚¬μš©μž ν–‰λ™μ˜ κ²°κ³Όλ₯Ό 넣을 수 μžˆλŠ” μ»¨ν…Œμ΄λ„ˆ μš”μ†Œ
  • oninout : This event occurs when the value of an <input> or <textarea> element is changed.
    => <input>μ΄λ‚˜ <textarea>의 값이 λ³€ν•  λ•Œ λ°œμƒν•˜λŠ” 이벀트
  • <progress> : The <progress> HTML element displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
    => <progress> νƒœκ·ΈλŠ” μž‘μ—…μ˜ 진행λ₯ μ„ λ³΄μ—¬μ£ΌλŠ” μš”μ†Œ
<form>
  <fieldset oninput="volume.value=parseInt(volumeBar.value)">
    <legend>Volume</legend>
    <input id="volumeBar" name="bar" type="range" title="λ²”μœ„μ„ νƒ" />
    <output name="volume" title="λ³Όλ₯¨ν‘œμ‹œ">0</output>
  </fieldset>
</form>
Volume 0
<!-- MDN -->
<form oninput="result.value=parseInt(a.value)+parseInt(b.value)">
  <input type="range" id="b" name="b" value="50" /> +
  <input type="number" id="a" name="a" value="10" /> =
  <output name="result" for="a b">60</output>
</form>
+ = 60
<!-- brνƒœκ·Έ μ‚¬μš© 주의 -->
<form>
  <fieldset>
    <legend>Programming Skill</legend>
      <label for="html">HTML</label>
      <progress id="html" value="85" max="100">85%</progress><br />
      <label for="css">CSS</label>
      <progress id="css" value="85" max="100">85%</progress><br />
      <label for="javascript">Javascript</label>
      <progress id="javascript" value="35" max="100">35%</progress><br />
  </fieldset>
</form>  
Programming Skill HTML 85%
CSS 85%
Javascript 35%

shadow DOM => 링크λ₯Ό μ°Έκ³ ν•˜μž!

<label> μ‚¬μš©λ²•

  • ν…μŠ€νŠΈμ˜ μ„€λͺ…κ³Ό 폼 μž…λ ₯ λͺ¨λ‘λ₯Ό ν¬ν•¨ν•˜λŠ” 방식
<label>
  이름 :
  <input type="text" name="name">
</label>
  • 폼 μž…λ ₯μ—μ„œ λΆ„λ¦¬ν•˜μ—¬ for속성을 μ΄μš©ν•΄ λ ˆμ΄λΈ”μ„ μ§€μ •ν•˜λŠ” 방식
<label for="myName">이름 : </label>
<input type="text" name="name" id="myName">

ν…Œμ΄λΈ” νƒœκ·Έ

블둝 레벨 μš”μ†Œ, 인라인 레벨 μš”μ†Œ

  • μš”μ†Œ 레벨 λ³€κ²½ : CSS display 속성을 μ‚¬μš©ν•΄ μš”μ†Œμ˜ μ‹œκ°μ  ν‘œν˜„ λ ˆλ²¨μ„ λ°”κΏ€ 수 μžˆλ‹€. ν•˜μ§€λ§Œ 이 방법을 μ‚¬μš©ν•΄λ„ μš”μ†Œμ˜ μΉ΄ν…Œκ³ λ¦¬μ™€ μ½˜ν…μΈ  λͺ¨λΈμ€ λ°”λ€Œμ§€ μ•ŠλŠ”λ‹€. 즉 <span>μš”μ†Œμ˜ displayλ₯Ό block으둜 μ§€μ •ν•œλ‹€ 해도, κ·Έ μ•ˆμ— 블둝 레벨 μš”μ†ŒμΈ <div>λ₯Ό 넣을 수 μ—†λ‹€.

πŸ“Ž CSS

p {
  font-size: 14px;
  color: yellow;
}  
  • p : selector
  • font-size, color : sroperty
  • 14px, yellow : value
  • font-size: 14px;, color: yellow : declaration

    1996λ…„ CSS1, 1998λ…„ CSS2, 2005λ…„ CSS3, 개발 쀑이며, κ·Έλ¦¬λ“œ λ ˆμ΄μ•„μ›ƒμ˜ 경우 레벨1에도 λ„λ‹¬ν•˜μ§€ λͺ»ν–ˆκΈ° λ•Œλ¬Έμ— μ •ν™•νžˆ μš°λ¦¬κ°€ λ°°μš°λŠ” 것을 CSS3라고 말할 수 μ—†λ‹€.

CSS μ μš©ν•˜κΈ°

  • 인라인 방식, λ‚΄λΆ€ μŠ€νƒ€μΌ μ‹œνŠΈ, μ™ΈλΆ€ μŠ€νƒ€μΌ μ‹œνŠΈ
  • CSS 파일 μ•ˆμ— CSS ν¬ν•¨ν•˜κΈ°: @rk λΆ™λŠ” 문법 = at-rule
@import url("hello.css");
@import url(hello.css);
@import url("./hello.css");
@import "hello.css"; 
/* @import hello.css;λŠ” μ•ˆλ©λ‹ˆλ‹€.*/

RESET CSS

/* style.css - μ΄ˆκΈ°μ„€μ • */
* {
  box-sizing : border-box;
}

곡백처리, 주석 및 λ²€ν„° ν”„λ¦¬ν”½μŠ€

  • 곡백처리
h1 {color: black;}
h1 {
    color: black;
}
h1 {
    color : black;}
h1 {
    border: solid 1px black;
}
h1 {
    border: solid 1px black;
}
h1 {
    border: 
        solid 
        1px 
        black;
}
h1 {
    border: 
        solid 
        1px 
        black
    ;
}
  • 주석
/* ν•œ 쀄, μ—¬λŸ¬ 쀄 λͺ¨λ‘ μ΄λ ‡κ²Œ μ‚¬μš©ν•©λ‹ˆλ‹€. */
  • 벀더 ν”„λ¦¬ν”½μŠ€ : 밴더 ν”„λ¦¬ν”½μŠ€ μžλ™μ™„μ„±
    • -webkit- : μ›Ήν‚€νŠΈ 기반 λΈŒλΌμš°μ € / 크둬, μ•ˆλ“œλ‘œμ΄λ“œ, μ‚¬νŒŒλ¦¬ λ“±
    • -moz- : λͺ¨μ§ˆλΌ 기반 λΈŒλΌμš°μ € / νŒŒμ΄μ–΄ν­μŠ€ λ“±
    • -ms- : 인터넷 μ΅μŠ€ν”Œλ‘œλŸ¬
    • -o- : 였페라 기반 λΈŒλΌμš°μ €

CSS selector

  • 속성 μ„ νƒμž

    • νƒœκ·Έ[속성] : ν•΄λ‹Ή 속성을 가진 νƒœκ·Έ 선택
    • νƒœκ·Έ[속성="λ³€μˆ˜"] : μ†μ„±μ˜ 값이 λ³€μˆ˜μ™€ μΌμΉ˜ν•˜λŠ” νƒœκ·Έ 선택, 곡백을 ν¬ν•¨ν•˜μ§€ μ•ŠλŠ”λ‹€
    • νƒœκ·Έ[속성~="λ³€μˆ˜"] : μ†μ„±μ΄λ¦„μ˜ 값이 λ³€μˆ˜λ₯Ό ν¬ν•¨ν•˜λŠ” νƒœκ·Έ 선택, 곡백 포함
    • νƒœκ·Έ[속성^="λ³€μˆ˜"] : 속성 값이 λ³€μˆ˜λ‘œ μ‹œμž‘ν•˜λŠ” νƒœκ·Έ 선택
    • νƒœκ·Έ[속성$="λ³€μˆ˜"] : 속성 값이 λ³€μˆ˜λ‘œ λλ‚˜λŠ” νƒœκ·Έ 선택
    • νƒœκ·Έ[속성*="λ³€μˆ˜"] : 속성 값이 λ³€μˆ˜ λ¬Έμžμ—΄μ„ 포함 νƒœκ·Έ 선택
    • νƒœκ·Έ[속성|="λ³€μˆ˜"] : 속성 값이 λ³€μˆ˜ μ΄κ±°λ‚˜ λ³€μˆ˜λ‘œ μ‹œμž‘ν•˜λŠ” νƒœκ·Έ 선택
      μ„ νƒμž μ—°μŠ΅ μ‚¬μ΄νŠΈ
  • 가상 클래슀 μ„ νƒμž : μ‹€μ œλ‘œ html에 μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” ν΄λž˜μŠ€μ§€λ§Œ 마치 클래슀λ₯Ό 놓은 κ²ƒμ²˜λŸΌ μž‘λ™ / nth-child, active, focus, hover λ“±

  • 가상 μš”μ†Œ μ„ νƒμž : λ§ˆν¬μ—… μ—†λŠ” μš”μ†Œλ₯Ό μ‚½μž… / after, before λ“±

  • μš°μ„  μˆœμœ„ : id > class > tag 순

  • μš°μ„  μˆœμœ„ 계산 : μ„ νƒμž μš°μ„  μˆœμœ„λŠ” ꡬ체적으둜 μˆ«μžλ‘œμ„œ 계산이 κ°€λŠ₯

    • !important : μ ˆλŒ€μ μΈ μš°μ„  μˆœμœ„. μ‰¬μš΄ λ°©λ²•μ΄μ§€λ§Œ λΆˆκ°€ν”Όν•œ 상황이 μ•„λ‹ˆλΌλ©΄ μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” 것이 μ’‹λ‹€.
    • inline-style : 1000점
    • id : 100점
    • class, κ°€μƒν΄λž˜μŠ€ μ„ νƒμž : 10점
    • μš”μ†Œ, κ°€μƒμš”μ†Œ μ„ νƒμž : 1점
      μš°μ„  μˆœμœ„ 계산 μ°Έκ³  링크

declarantions

  • λ‹¨μœ„ - κ³ μ • 크기 λ‹¨μœ„
    • κ³ μ •λœ 크기λ₯Ό μ§€μ›ν•˜κΈ° λ•Œλ¬Έμ— κΈ€μž 크기의 λ³€ν™”κ°€ μš©μ΄ν•˜λ‹€
    • κΈ°λ³Έ px의 크기 = 16px
    • px(ν”½μ…€), pt(포인트), in(인치), cm(μ„Όν‹°λ―Έν„°), mm(밀리미터)
  • λ‹¨μœ„ - κ°€λ³€ 크기 λ‹¨μœ„
    • em : 배수 λ‹¨μœ„ / λΆ€λͺ¨μ˜ κΈ€μž 크기에 따라 기쀀점이 달라진닀.
      (λΆ€λͺ¨μ˜ 크기 κ°’ * μžμ‹μ˜ em κ°’) = μžμ‹μ΄ κ°€μ§€κ²Œ 될 크기 κ°’
    • rem : root em / μ΅œμƒμœ„ μš”μ†Œμ˜ κΈ€μž 크기에 따라 달라진닀.
    • % : λ°±λΆ„μœ¨ λ‹¨μœ„ / 100% = 1
      λΆ€λͺ¨μ˜ 크기 & (μžμ‹μ˜ %κ°’ / 100) = μžμ‹μ΄ κ°€μ§€κ²Œ 될 px κ°’
    • vw : ν™”λ©΄λΉ„ λ°±λΆ„μœ¨ λ‹¨μœ„
    • vh : ν™”λ©΄λΉ„ λ°±λΆ„μœ¨ 단뒀
    • vmin : ν™”λ©΄λΉ„ μ΅œμ†Ÿκ°’
    • vmax : ν™”λ©΄λΉ„ μ΅œλŒ“κ°’
    • ex : ν˜„μž¬ 폰트의 x-height κ°’

마무리

  • μ™Έκ΅­μœΌλ‘œ μ·¨μ—…ν•˜λŠ” 것에 κ΄€μ‹¬μžˆλŠ” μ‚¬λžŒ? μ €μš”! => 손코딩 μΆ”μ²œ!
  • νƒœλΈ”λ¦ΏμœΌλ‘œλ„ 코딩을 ν•  수 μžˆλ‹€! μ•„μ΄νŒ¨λ“œλ₯Ό μ‚΄ λͺ…뢄이 μƒκ²ΌμŠ΅λ‹ˆλ‹€.
  • λͺ¨λ‹ˆν„°κ°€ 1개 더 μžˆμ—ˆμœΌλ©΄ μ’‹κ² λ‹€. 히히
  • μˆ˜μ—… λ‚΄μš©μ„ μ •λ¦¬ν•˜λŠ” 것이 쉽지 μ•Šλ‹€. 저녁먹고 λ‚˜λ„ λͺ¨λ₯΄κ²Œ 잠이 λ“€μ–΄μ„œ 깜짝 λ†€λž€λ‹€. => 벌써 μž… μ•ˆμ— 염증이 μƒκ²ΌμŠ΅λ‹ˆλ‹€.
  • λ‚˜ μžμ‹  γ…Ž..ν™”..이...νŒ…!!

0개의 λŒ“κΈ€