CSS-1

CSS-1


~์›น์€ ์–ธ์–ด๋“ค๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค. ๊ฐ€์žฅ ํฌ๊ฒŒ 3๊ฐ€์ง€๋กœ ๋‚˜๋ˆ„๋ฉด, HTML, CSS, JavaScript๊ฐ€ ์žˆ๋‹ค.

HTML: ๋ผˆ๋Œ€, CSS: ๊ทผ์œก, JavaScript: ๋‡Œ

CSS : Cascading Style Sheet, ์ˆœ์„œ๋Œ€๋กœ ๋œ ์Šคํƒ€์ผ ์‹œํŠธ์ด๋‹ค.
ํƒœ๊ทธ๋ฅผ ์ค‘๋ณตํ•ด์„œ ๋งŒ๋“ค์—ˆ๋‹ค๋ฉด ์ฝ”๋“œ์˜ ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰ ๋ถ€๋ถ„์ด ์Šคํƒ€์ผ๋กœ ์ ์šฉ๋œ๋‹ค.

์™ธ์šธ ํ•„์š”์—†๋‹ค. ๋ชจ๋ฅด๋Š” ์œ ํ˜•์ด ๋‚˜์˜ค๋ฉด Google, MDN์„ ์ฐพ์•„๋ณด์ž.
Do not memorize !




Add CSS to HTML

  • HTML์— CSS ์Šคํƒ€์ผ ์‹œํŠธ๋ฅผ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”๋ฐ, 2๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค.
  1. ์ƒˆ๋กœ์šด ์Šคํƒ€์ผ ์‹œํŠธ๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ
  2. HTML ๋ฌธ์„œ์— ์Šคํƒ€์ผ ์‹œํŠธ๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ.
<head>
  <title>Home - My first website.</title>
  <!-- first case -->
  <link rel="stylesheet" href="style.css" />

  <!-- second case -->
  <style></style>
</head>



Writing Our First CSS Lines

  • CSS๋Š” HTML ๋ฌธ์„œ์— ์žˆ๋Š” ํƒœ๊ทธ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๊ณ  ์ค‘๊ด„ํ˜ธ๋ฅผ ์ด์šฉํ•ด์„œ ๊ทธ ์•ˆ์— ์†์„ฑ์„ ์จ์ค€๋‹ค.
<style>
  h1 {
    color: blue;
    font-style: italic;
    font-size: 20px;
  }
</style>



Blocks and Inlines

  • Block์€ ๋‹ค๋ฅธ ์š”์†Œ๊ฐ€ ์˜†์— ์˜ค์ง€ ๋ชปํ•˜๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•˜๊ณ , Inlines๋Š” ๋‹ค๋ฅธ ์š”์†Œ๊ฐ€ ์˜†์— ์˜ฌ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•œ๋‹ค. Block์˜ ์˜ˆ๋กœ๋Š” <div>, <blockquote>, <header> โ€ฆ Inline์˜ ์˜ˆ๋กœ๋Š” , , ๊ฐ€ ์žˆ๋‹ค.



Margin-1

  • Block์„ inline์ฒ˜๋Ÿผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๊ฒƒ? display: inline
  • inline์„ block์ฒ˜๋Ÿผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๊ฒƒ? display: block
  • ๋ธŒ๋ผ์šฐ์ €๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์Šคํƒ€์ผ ์†์„ฑ์„ ์ค€๋‹ค.
  • Block : margin, border, padding
  • Margin์€ box์˜ ๊ฒฝ๊ณ„ ๋ฐ”๊นฅ์ชฝ์— ์žˆ๋‹ค. body๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ body๋ผ๋Š” box์˜ boder๋ฐ”๊นฅ์— 8px์˜ ์—ฌ๋ฐฑ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค. (default)

s1


Margin-2

  • margin: num โ€“> ์‚ฌ๋ฐฉ์— margin์„ ์ค€๋‹ค.
    margin: num1 num2 โ€“> ์œ„ ์•„๋ž˜์— num1 ์ขŒ์šฐ์— num2๋งŒํผ์˜ margin์„ ์ค€๋‹ค.
    margin: num1 num2 num3 num4 โ€“> ๊ฐ๊ฐ ์œ„, ์˜ค๋ฅธ, ์•„๋ž˜, ์™ผ์ชฝ์— margin์„ ์ค€๋‹ค.

  • ์œ„์˜ ๊ทธ๋ฆผ์—์„œ ํ•˜์–€์ƒ‰ ๋ฐ•์Šค(div๋ฐ•์Šค) ์™€ ์‚ด๊ตฌ์ƒ‰ ๋ฐ•์Šค(body ๋ฐ•์Šค) ๊ฐ€ top๊ฒฝ๊ณ„์—์„œ ๊ฒน์ณ์žˆ์„ ๋•Œ,
    ํ•˜์–€์ƒ‰ ๋ฐ•์Šค์˜ top์— margin์„ ์ฃผ๋ฉด, body ๋ฐ•์Šค๊นŒ์ง€ ์ „์ฒด๊ฐ€ ๋”ธ๋ ค ๋‚ด๋ ค์˜ค๊ฒŒ๋œ๋‹ค.

  • ์ด ํ˜„์ƒ์„ Collapsing Margin ์ด๋ผ๊ณ  ํ•˜๋ฉฐ, ์„œ๋กœ ๋ถ„๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด์„œ Padding์ด๋ผ๋Š” ๊ฐœ๋…์ด ํ•„์š”ํ•˜๋‹ค.

    • Pading and IDs

      • Padding์€ ๊ฒฝ๊ณ„์˜ ์•ˆ์ชฝ ๊ณต๊ฐ„์ด๋‹ค.
        Padding์— margin์„ ์ค€๋‹ค๋ฉด border๋ถ€๋ถ„์ด ๊ฒน์น˜์ง€ ์•Š๋Š”๋‹ค.
        ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐ ํƒœ๊ทธ์— id๋ฅผ ์ฃผ๊ณ  div์•ˆ์— div๋ฅผ ๋ฐฐ์น˜ํ•ด๋‘ฌ ๊ฐ ๊ฒฝ๊ณ„์˜ ์‹œ์ž‘์„ ๋‹ค๋ฅด๊ฒŒ ์ฃผ์—ˆ๋‹ค.
        ๊ทธ๋ฆฌ๊ณ  padding margin์„ ์ฃผ๋ฉด์„œ ์„œ๋กœ ๋‹ค๋ฅธ box์ธ ๊ฒƒ์„ ๋ณด์—ฌ์ค€๋‹ค.
<style>
      html {
        background-color: tomato;
      }
      body {
        /* margin: 0px; */
        padding: 10px;
        background-color: wheat;
        /* margin: 0; */
      }
      div {
        margin-top: 10px;
        margin-left: 10px;
        width: 10px;
        height: 10px;
        padding: 10px;
        background-color: red;
      }
      #first {
        background-color: teal;
        width: 150px;
        height: 150px;
      }
      #second {
        background-color: orange;
        width: 100px;
        height: 100px;
      }
      #third {
        background-color: purple;
        width: 50px;
        height: 50px;
      }
      #fourth {
        background-color: red;
        width: 25px;
        height: 25px;
      }
    </style>
  </head>
  <body>
    <div id="first">
      <div id="second">
        <div id="third">
          <div id="fourth"></div>
        </div>
      </div>
    </div>
  </body>

s2



Border

  • Border์€ ๊ฒฝ๊ณ„๋ฅผ ์˜๋ฏธํ•˜๊ณ , CSS๋ฅผ ํ†ตํ•ด ํฌ๊ธฐ์™€ ์ƒ‰์„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

  • โ€™*โ€™ ์€ ๋ชจ๋“  box์— ์ ์šฉํ•œ๋‹ค๋Š” ์˜๋ฏธ์ด๋‹ค.

* { border: 2px solid black; }
  • border์€ inline ๊ณผ block ๋ชจ๋‘์— ์ ์šฉ๋œ๋‹ค. ( (์ธ๋ผ์ธ) , <div> (๋ธ”๋ฝ) ์™€ ๊ฐ™์€ ํƒœ๊ทธ๋“ค ) ๊ทธ๋ ‡๋‹ค๋ฉด inline์—์„œ margin, padding์€ ์ ์šฉ์ด ๋ ๊นŒ??

  • Inline์—์„œ๋Š” margin์ด ์ ์šฉ๋˜๋Š” ๋ถ€๋ถ„์ด ํ•œ์ •์ ์ด๋‹ค. inline์€ ๋†’์ด์™€ ๋„ˆ๋น„๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์— margin์ด ์ ์šฉ๋˜๋ฉด ์ขŒ, ์šฐ์—๋งŒ ์ ์šฉ๋œ๋‹ค. โ€“> ๋”ฐ๋ผ์„œ ์ƒํ•˜์— ๋งˆ์ง„์„ ์ ์šฉ์‹œํ‚ค๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ block์œผ๋กœ ๋ฐ”๊ฟ”์„œ margin์„ ๋„ฃ์–ด์ฃผ์–ด์•ผํ•œ๋‹ค.
  • padding์˜ ๊ฒฝ์šฐ ์‚ฌ๋ฐฉ์— ์ ์šฉ์ด ๋œ๋‹ค.



Classes

  • class

    • id์˜ ๊ฒฝ์šฐ ํ•˜๋‚˜์˜ ํƒœ๊ทธ๋‹น ํ•˜๋‚˜์˜ id๋งŒ ์ ์šฉ๋œ๋‹ค. ํ•˜์ง€๋งŒ class์˜ ๊ฒฝ์šฐ ๋‹ค์–‘ํ•œ ํƒœ๊ทธ๋“ค์— ์ ์šฉ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค. ๋˜ํ•œ, class์˜ ๊ฒฝ์šฐ, ํƒœ๊ทธ์— ์—ฌ๋Ÿฌ๊ฐ€์ง€ ํด๋ž˜์Šค๋ฅผ ๋™์‹œ์— ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋‹ค.
      id๋ฅผ ์ด์šฉํ•  ๊ฒฝ์šฐ #์„ ์จ์„œ style์„ ์ง€์ •ํ•ด์ค€๋‹ค.
      class๋ฅผ ์ด์šฉํ•  ๊ฒฝ์šฐ .์„ ์จ์„œ style์„ ์ง€์ •ํ•ด์ค€๋‹ค.

    #tomato = id=โ€tomatoโ€ .tomato = class=โ€tomatoโ€



    <style>
      span {
        margin: 5px;
        border-style: dotted;
        font-size: 15%;
      }
      .btn {
        padding: 5px 5px;
        border-radius: 5px;
      }
      .teal {
        background-color: teal;
      }
      .tomato {
        background-color: tomato;
        color: white;
      }
    </style>
  </head>
  <body>
    <span class="btn tomato"> hello </span>
    <span class="btn teal"> hello </span>
    <span class="btn tomato"> hello </span>
    <span class="btn teal"> hello </span>
    <span class="btn tomato"> hello </span>
    <span class="btn teal"> hello </span>



inline-block

  • Display์˜ ์ข…๋ฅ˜์—๋Š” inline, block, inline-block์ด ์žˆ๋‹ค.
  • inline์˜ ๊ฒฝ์šฐ ๋†’์ด์™€ ๋„ˆ๋น„๊ฐ€ ๋ฌด์‹œ๋˜์–ด display๋˜์ง€ ์•Š๊ณ ,
    block์˜ ๊ฒฝ์šฐ ์˜†์œผ๋กœ ๋‚˜๋ž€ํžˆ ๋‚˜์˜ค๊ฒŒ ํ•˜์ง€ ๋ชปํ•œ๋‹ค.
    inline-block์˜ ๊ฒฝ์šฐ block์˜ ๋ชจ์–‘์„ ๊ฐ€์ง€๋ฉด์„œ ์˜†์œผ๋กœ ๋‚˜๋ž€ํžˆ ์˜ค๊ฒŒํ•  ์ˆ˜ ์žˆ๋‹ค.
  • inline-block์˜ ๋‹จ์ ์€.. ๊ทธ ์‚ฌ์ด margin์˜ ์ •ํ™•ํ•œ ๊ทœ์น™์ด ์—†๋‹ค.
    ๋ฐ˜์‘ํ˜• ์›น์‚ฌ์ดํŠธ์—์„œ ๋‹ฌ๋ผ์ง„๋‹ค.
display: inline-block;



Flexbox-1

  • inline-Block์˜ ๋‹จ์ ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ display: flex๋ผ๋Š” ๊ฒƒ์„ ์“ด๋‹ค.
    ๋‹จ, ๋ถ€๋ชจ element(div์˜ ๊ฒฝ์šฐ body)์—์„œ๋งŒ ๋ช…์‹œํ•œ๋‹ค!

  • justify-content / align-center ๋ฅผ ํ†ตํ•ด block์˜ ์†์„ฑ์„ ๊ฒฐ์ •ํ•ด์ค€๋‹ค.
    justify-content ๋Š” main-axis(์ˆ˜ํ‰ ๋””ํดํŠธ) ์ ์šฉ, align-items๋Š” cross-axis(์ˆ˜์ง ๋””ํดํŠธ)์— ์ ์šฉํ•œ๋‹ค.

  • ์ฃผ์˜ํ•ด์•ผํ•  ๊ฒƒ์€ justify-content๋Š” main-axis์— ์ ์šฉ๋  ๋ฟ, โ€˜์ˆ˜ํ‰โ€™์— ์ ์šฉ๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ๋Š” ์ ์ด๋‹ค.
    ์™œ๋ƒํ•˜๋ฉด main-axis๋กœ ์ˆ˜ํ‰ ์ˆ˜์ง์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

  • vh ( viewport height )๋กœ ํ™”๋ฉด ๋น„์œจ์„ ๋‚˜ํƒ€๋‚ธ๋‹ค.
    ( ์•„๋ž˜ ์˜ˆ์‹œ๋Š” ํ™”๋ฉด ๋น„์œจ์˜ 100%๋ฅผ ๋‚˜ํƒ€๋‚ธ ๊ฒƒ )

<style>
  body {
        height: 100vh;
        margin: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      div {
        width: 300px;
        height: 300px;
        background-color: teal;
      }
</style>



Flexbox-2

  • flex-direction์„ ํ†ตํ•ด main-axis์˜ ์ถ•์˜ ์ˆ˜ํ‰ ์ˆ˜์ง ์œ„์น˜๋ฅผ ๋ณ€๊ฒฝ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค.
    (column, row, column-reverse, row-reverse)
    main-axis์˜ default๋Š” ? flex-direction: row ๋ผ๊ณ  ์ƒ๊ฐํ•˜์ž.

  • div๋‚ด์˜ ์ปจํ…์ธ ๋ฅผ flex์ปจํ…Œ์ด๋„ˆ๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ div ๋ฐ•์Šค ๋‚ด์—์„œ flex๋ฅผ ๋ช…์‹œํ•ด์•ผํ•œ๋‹ค.

  • flex-wrap ๊ธฐ๋Šฅ์˜ wrap์€ ๋ฐ˜์‘ํ˜• ์›นํŽ˜์ด์ง€์—์„œ ํฌ๊ธฐ๊ฐ€ ๋ณ€ํ˜•๋˜๊ณ  ์œ„์น˜๊ฐ€ ๋ฐ”๋€Œ๊ฒŒ ํ•ด์ค€๋‹ค.

   <style>
      body {
        height: 100vh;
        margin: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        flex-wrap: wrap;
      }
      div {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 300px;
        height: 300px;
        color: black;
        font-size: 100px;
        background-color: teal;
      }
      #mid {
        background-color: wheat;
      }
    </style>
  </head>
  <body>
    <div>1</div>
    <div id="mid">2</div>
    <div>3</div>
  </body>

s3



Position

  • position: fixed๋Š” block์ด ํ˜„์žฌ ์œ„์น˜์— ๊ณ ์ •๋˜์–ด์žˆ๋Š” ์ƒํƒœ

  • 1000vh๋ฅผ ์ค˜์„œ ํ™”๋ฉด์˜ ๊ธธ์ด๋ฅผ ๊ธธ๊ฒŒํ•˜๊ณ  green๋งŒ position์„
    fix์‹œํ‚ค๋ฉด ์Šคํฌ๋กค์„ ๋‚ด๋ ค๋„ ๋ ˆ์ด์•„์›ƒ์— ์ƒ๊ด€์—†์ด ๊ณ„์† ๋”ฐ๋ผ์˜จ๋‹ค. ex) netflix platform

<style>
      body {
        height: 1000vh;
        margin: 20px;
      }
      div {
        width: 300px;
        height: 300px;
        color: white;
        background-color: teal;
        opacity: 0.5;
      }
      #green {
        position: fixed;
      }
      #different {
        background-color: wheat;
      }
    </style>
  </head>
  <body>
    <div id="green"></div>
    <div id="different"></div>
  </body>

s4



Relative, Absolute

  • position: relative : ์ฒซ ์œ„์น˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ƒํ•˜์ขŒ์šฐ ์›€์ง์ž„์„ ๋งŒ๋“ค์–ด์คŒ.

  • position: absolute : ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด relativeํ•œ ๋ถ€๋ชจ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์œ„์น˜๋ฅผ ์›€์ง์ธ๋‹ค.
    ๋ถ€๋ชจ์—๊ฒŒ relative๊ฐ€ ์—†๋‹ค๋ฉด body๊ฐ€ ๊ธฐ์ค€์ด ๋œ๋‹ค. (
    body๋„ relative๊ฐ€ ์—†๋‹ค๋ฉด vh๋ฅผ ๋„“ํ˜€๋„ ๋๊นŒ์ง€ ๊ฐ€์ง€ ์•Š๋Š”๋‹ค.)
  • position: static : default



Pseudo Selector-1

  • first-child, Last-child, nth-child()
  • ๋ฐ˜๋ณต๋˜๋Š” ํƒœ๊ทธ๋“ค์—์„œ ํŠน์ • ๊ทœ์น™์„ ๊ฐ€์ง„ ํƒœ๊ทธ๋ฅผ ๊ณ ๋ฅด๊ฑฐ๋‚˜,
    ํƒœ๊ทธ๋ฅผ ์ง์ ‘ ์„ ํƒํ•˜๊ณ  ์‹ถ์„ ๋•Œ, pseudo selector๋ฅผ ์‚ฌ์šฉํ•˜์ž.
  <style>
  span:nth-child(3n + 1) {
        background-color: tomato;
      }
      span:last-child {
        background-color: teal;
      }
  </style>



Pseudo Selectors-2

  • class ๋ฅผ ์“ฐ์ง€ ์•Š๊ณ  input์— ์žˆ๋Š” attribute๋ฅผ ์ด์šฉํ•˜์—ฌ style์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค.
    • ~= โ€œnameโ€ โ€“> โ€œnameโ€์„ ํฌํ•จํ•œ ๋ฌธ์ž๋“ค์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” input
    • attribute์˜ ํŠน์„ฑ์„ ํ™œ์šฉํ•  ๋•Œ, ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ด์šฉํ•œ๋‹ค. ex) [placeholder], :required
 input[placeholder~="name"] {
        background-color: thistle;
      }
input:required {
        border-color: tomato;
      }



Combinators

  • ๋ถ€๋ชจ ๋ฐ‘์— ์ž์‹์„ ์„ ํƒํ•  ๊ฒฝ์šฐ : p span
  • ๋ถ€๋ชจ ๋ฐ”๋กœ ๋ฐ‘์— ์ž์‹์„ ์„ ํƒํ•  ๊ฒฝ์šฐ : p > span
  • ์ž์‹ ๋ฐ”๋กœ ์˜†์— ํ˜•์ œ๋ฅผ ์„ ํƒํ•  ๊ฒฝ์šฐ : p + span
  • ์ž์‹ ์˜†์— ํ˜•์ œ๋ฅผ ์„ ํƒํ•  ๊ฒฝ์šฐ : p ~ span
<style>
p > span {
        background-color: teal;
        text-decoration: line-through;
      }

p + span {
        background-color: teal;
        text-decoration: line-through;
      }

p span {
        background-color: teal;
        text-decoration: line-through;
      }

p ~ span {
        background-color: teal;
        text-decoration: line-through;
      }
</style>
<body>
<p>hi baby <span>inside</span></p>
      <span>hello</span>
</body>



States

  • active ( ๋ˆŒ๋ €์„ ๋•Œ (๋ฒ„ํŠผ) )
    hover ( ํ‚ค๋ณด๋“œ๊ฐ€ ๊ฐ€๋ฆฌํ‚จ ์ƒํƒœ )
    focus ( ํ‚ค๋ณด๋“œ ๋™์ž‘ )
    visit ( ๋ฐฉ๋ฌธํ–ˆ์„ ๋•Œ)

  • form:focus-within ( element๊ฐ€ focus๋˜๋ฉด ๋ฐ˜์‘์ด ๋œ๋‹ค. )
    form:hover input:focus ( form์— ์˜ฌ๋ผ ์žˆ์œผ๋ฉด์„œ input์— ํ‚ค๋ณด๋“œ ๋™์ž‘์ด ์‹œ์ž‘๋  ๋•Œ )

  • attribute

    • ::placeholder (placeholder์˜ ํŠน์„ฑ๋งŒ ๋ฐ”๊พธ๊ณ  ์‹ถ์„ ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.)
      ::selection (ํด๋ฆญํ•ด์„œ ๊ธ์„ ๋•Œ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.)
      ::first-letter (์ฒซ ๊ธ€์ž์—๋งŒ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.)
      ::first-lines (์ฒซ ์ค„์—๋งŒ ์ž‘์šฉํ•ฉ๋‹ˆ๋‹ค.)
<style>
form:hover input:focus {
        background-color: sienna;
      }
      form:focus-within {
        border-color: silver;
      }
      button:active {
        color: red;
      }
</style>



Color and Variabels

  • Color์˜ ํ‘œํ˜„ ๋ฐฉ์‹์€ 3๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค.
    1. hexadeciamal color(color code)
    2. rgb(252, 206, 0)
    3. rgba (252, 206, 0, 1) (a๋Š” ํˆฌ๋ช…๋„๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค.)
  • custom properties : color๋ฅผ ๋ณ€์ˆ˜ํ™”ํ•ด์„œ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค.
<style>
:root {
        --main-color: #fcce00;
        --default-border: 1px solid var(--main-color);
      }
      a {
        color: var (--default-border);
      }
</style>

ํƒœ๊ทธ: , ,

์นดํ…Œ๊ณ ๋ฆฌ:

์—…๋ฐ์ดํŠธ: