CSS 101

Cascading Style Sheets

​ css

μ›ν•˜κ³ μž ν•˜λŠ” κΈ°λŠ₯의 property λ₯Ό ꡬ글링 ν•˜μž

  1. style νƒœκ·Έ μ“°κΈ°

    <style>
            a {
                color:red;
                text-decoration: none;
            }
    </style>
  2. style 속성 μ“°κΈ°

    <li><a href="1.html"><font color='red'> HTML </font></a> </li>

Selector

id < class < tag

css seclector λ₯Ό κ²€μƒ‰ν•΄λ³΄μž

  1. tag

    • λͺ¨λ“  νƒœκ·Έμ— λŒ€ν•΄

  2. .class

    <style>
      .class1 {
        ~
      }
      .class2 {
    
      }
    </style>
    
    <body>
      <class='class1 class2'> </>
        -> style νƒœκ·Έμ—μ„œ μˆœμ„œλŒ€λ‘œ 됨
    </body>
  3. id

  4. μ–΄λ–€ id μ•ˆμ˜ μ–΄λ–€ νƒœκ·Έ

    # id tag {
    
    }

Property

  1. border

  2. display

  3. padding

    μš”μ†Œκ°€ μ°¨μ§€ν•˜λŠ” μΉΈ

  4. margin

    μš”μ†Œκ°„ μ°¨μ§€ν•˜λŠ” μΉΈ

  5. width

    κ°€λ‘œ μ°¨μ§€ν•˜λŠ” μΉΈ

  6. display

    κ°•λ ₯함. μ–΄λ–»κ²Œ λ³΄μ΄λŠ”μ§€ 해쀄 수 있음 inline block λ°”κΏ€ 수 있고 none κ°€λŠ₯

Box

  1. block level element (div)

    전체λ₯Ό 씀

  2. Inline element (span)

    μš”μ†Œλ§ŒνΌλ§Œ 씀

Grid

css 의 μ΅œμ‹ κΈ°μˆ 

  1. how to use

λ―Έλ””μ–΄ 쿼리

λ””λ°”μ΄μŠ€λ§ˆλ‹€, ν™”λ©΄μ˜ 크기에 따라 λ³΄μ—¬μ§€λŠ” 것 λ‹€λ₯΄κ²Œ

  • how to use

  • how to use 2

css 파일 μž¬μ‚¬μš©ν•˜κΈ°

style.css νŒŒμΌμ„ λ§Œλ“€μ–΄μ„œ μž¬ν™œμš©ν•˜μž

  • html

  • style.css

Last updated