Skip to content

Latest commit

Β 

History

History
50 lines (40 loc) Β· 1.46 KB

File metadata and controls

50 lines (40 loc) Β· 1.46 KB

[HTML μ œλŒ€λ‘œ λ°°μ›Œ 볼래?] Ep#13-HTML Attribute(속성)

HTML Attribute

<!DOCTYPE html>
<html>
  <head>
    <title>Document</title>
  </head>
  <body>
    <!-- HTML 속성(attribute) -->
    <!-- HTML μš”μ†Œμ˜ 좔가적인 정보 제곡 -->
    <!-- λ°˜λ“œμ‹œ μ‹œμž‘νƒœκ·Έμ—λ§Œ μ‚¬μš© κ°€λŠ₯ -->

    <!-- 속성이름=속성값 -->
    <!-- hrefλŠ” a νƒœκ·Έμ—λ§Œ μ“°μž„ -->
    <a href="https://google.com">ꡬ글</a>

    <!-- 1. 정상 이미지 μ£Όμ†Œ μ•ˆλ„£μ—ˆμ„ λ–„ alt κ°’ λ‚˜μ˜΄ -->
    <!-- 2. μ‹œκ° μž₯μ•  κ°€μ§€μ‹  뢄듀은 기계(SW/HW)λ₯Ό 이용 -> νŽ˜μ΄μ§€ λ‚΄μš© μ½μ–΄μ£ΌλŠ” 뢀가적인 μ—­ν•  -->
    <!-- src 속성은 img와 script λ“± λͺ‡κ°€μ§€ νƒœκ·Έμ—λ§Œ μ“°μž„ -->
    <img
      src=""
      style="width: 100px; height: 100px"
      alt="이미지에 λŒ€ν•œ λΆ€κ°€ 정보, test.html, μ—°μŠ΅"
    />

    <!-- style 속성 -> ν˜„μž¬ HTML에 λ‹€μ–‘ν•œ μŠ€νƒ€μΌ μž…νž˜ -->
    <!-- λ””μžμΈ-속성이름=λ””μžμΈ-속성값 -->
    <p style="color: red; background-color: blue">λ¬Έμž₯μž…λ‹ˆλ‹€.</p>
    <script></script>
  </body>
</html>

[Note]

  • HTML Attribute (속성)
    • HTML element에 λŒ€ν•œ μΆ”κ°€ 정보 제곡 μœ„ν•¨
    • λ°˜λ“œμ‹œ μ‹œμž‘ νƒœκ·Έμ—λ§Œ μ‚¬μš© κ°€λŠ₯ (μ’…λ£Œνƒœκ·Έμ—λŠ” μ‚¬μš© λΆˆκ°€)
    • 속성이름과 속성값 ν˜•νƒœλ‘œ μ‚¬μš©λ¨
  • HTML μš”μ†Œλ§ˆλ‹€ μ‚¬μš© κ°€λŠ₯ν•œ 속성듀 차이가 쑰금 있음
  • HTML은 element(tag)λ“€μ˜ μ§‘ν•©

Reference