CSS-2

CSS-2


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

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

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

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




Transition - 1

  • transition : state๊ฐ€ ์•„๋‹Œ root์— ์žˆ์–ด์•ผ ํ•œ๋‹ค.
    ๋ณ€ํ™”ํ•˜๋Š” ๋ชจ์Šต์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด state์—๋„ ๋ณ€ํ™” ํŠน์„ฑ์ด ์žˆ์–ด์•ผ ํ•œ๋‹ค.
  • ease-in-out์„ ์ด์šฉํ•ด์„œ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค.
<style>
  div {
    width: 50px;
    height: 50px;
    background-color: teal;
    transition: all 1s ease-in-out;
  }
  div:hover {
    transform: rotateX(45deg);
  }
</style>



Transition - 2

  • ๋ณ€ํ™”ํ•˜๋Š” ์• ๋‹ˆ๋ฉ”์ด์…˜์˜ ์†๋„๋ฅผ ์ •ํ•ด์ฃผ๋Š” ease function์ด ์žˆ๋‹ค. goole go !
  • ๋””ํดํŠธ๋ฅผ ๊ฐ–๊ณ  ์žˆ๋Š” ease-in function
    linear / ease-in / ease-out / ease-in-out
  • all์„ ์ด์šฉํ•ด ๋ชจ๋“  ํŠน์„ฑ์„ ๋ณ€ํ™”์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค.
    ํŠน์ • ํŠน์„ฑ์„ ์ •ํ•ด์„œ ๋ณ€ํ™”์‹œํ‚ฌ ์ˆ˜ ์žˆ๋‹ค.
<style>
      a {
        color: white;
        background-color: tomato;
        text-decoration: none;
        padding: 3px 5px;
        border-radius: 5px;
        font-size: 50px;
        transition: all 1s ease-in-out;
        transition: background-color 1s ease-in-out, font-size 1s ease-in;
      }
      a:hover {
        font-size: 30px;
        color: teal;
        background-color: green;
        font-size: 70px;
      }



Transformation

  • block์ด๋‚˜ ๋‹ค๋ฅธ element์— ์˜ํ–ฅ์„ ์•ˆ์ฃผ๊ณ  3d๋กœ ์›€์ง์ด๊ฒŒ ํ•˜๋Š” ์—ญํ• ์ด๋‹ค.
  • ๋‹ค๋ฅธ ํŽ˜์ด์ง€์˜ ์ฐจ์›์—์„œ ์ผ์–ด๋‚˜๊ฒŒ ๋ณ€ํ™”๋ฅผ ์ค€๋‹ค.
    ๋‹ค๋ฅธ ๋ฐ•์Šค์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š๋Š”๋‹ค.
  • ๋‹ค์–‘ํ•œ ์†์„ฑ๋“ค์€ MDN ์ฐธ๊ณ ํ•˜์ž.
    <style>
      img {
        width: 10cm;
        height: 10cm;
        border: 10px solid black;
        border-radius: 50%;
        transition: all 1s ease-in-out;
      }
      img:hover {
        transform: rotateY(360deg);
      }
    </style>



Animations - 1

  • @keyframes name

<style>
      @keyframes coinFlip {
        from {
          transform: rotateY(0deg);
        }
        to {
          transform: rotateY(360deg);
        }
      }
      img {
        width: 10cm;
        height: 10cm;
        border: 10px solid black;
        border-radius: 50%;
        animation: coinFlip 5s ease-in-out infinite;
      }
</style>



Animations - 2

  • % ๋ฅผ ๋„ฃ์–ด์„œ ์• ๋‹ˆ๋ฉ”์ด์…˜์— ์—ฐ์†์„ฑ ๋ถ€์—ฌํ•˜๊ธฐ

    Pading and IDs
    • Padding์€ ๊ฒฝ๊ณ„์˜ ์•ˆ์ชฝ ๊ณต๊ฐ„์ด๋‹ค. Padding์— margin์„ ์ค€๋‹ค๋ฉด border๋ถ€๋ถ„์ด ๊ฒน์น˜์ง€ ์•Š๋Š”๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐ ํƒœ๊ทธ์— id๋ฅผ ์ฃผ๊ณ  div์•ˆ์— div๋ฅผ ๋ฐฐ์น˜ํ•ด๋‘ฌ ๊ฐ ๊ฒฝ๊ณ„์˜ ์‹œ์ž‘์„ ๋‹ค๋ฅด๊ฒŒ ์ฃผ์—ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  padding margin์„ ์ฃผ๋ฉด์„œ ์„œ๋กœ ๋‹ค๋ฅธ box์ธ ๊ฒƒ์„ ๋ณด์—ฌ์ค€๋‹ค.
<style>
@keyframes coinFlip {
        0% {
          transform: rotateY(0deg) translateX(-1000px);
        }
        25% {
          transform: translateX(-500px) translateY(500px);
        }
        50% {
          transform: rotateY(360deg) translateX(0px) translateY(1000px);
        }
        75% {
          transform: translateX(500px) translateY(500px);
        }
        100% {
          transform: rotateY(0deg) translateX(1000px);
        }
      }



Media Query & Media Queries recap

  • screen์˜ ์‚ฌ์ด์ฆˆ์— ๋”ฐ๋ผ ๋ณ€ํ™”๋ฅผ ์ฃผ๋Š” ๋ฒ•
  • screen์€ ํฌ๋กฌ ๋‚ด์— ํ•ธ๋“œํฐ ๋ชจ๋“œ๋กœ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด ๋‹ด๊ฒจ์žˆ๋‹ค.
  • screen and ~~~ and ~~~ and { ๋‚ด๋ถ€์—๋Š” element๊ฐ€ ๋“ค์–ด๊ฐ€์•ผ ํ•œ๋‹ค. }
  • screen ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ print ๋“ฑ,, ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค. check the MDN

<style>
@media screen and (min-width: 400px) and (max-width: 700px) and (orientation: landscape) {
    div {
      background-color: tomato;
    }
    .good {
      color: black;
    }
    span {
      display: none;
    }
}
</style>

ํƒœ๊ทธ: , ,

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

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