๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
CSS

[CSS] ์• ๋‹ˆ๋ฉ”์ด์…˜06 : ํ†ต!ํ†ต!ํ†ต! ํ…์ŠคํŠธ

by _ํ† ๋งคํ†  2022. 9. 29.
728x90

CSS : ์• ๋‹ˆ๋ฉ”๋‹ˆ์…˜ ๋งŒ๋“ค๊ธฐ : ํ†ตํ†ต ํ…์ŠคํŠธ ์• ๋‹ˆ๋ฉ”์ด์…˜

์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” CSS ์‹ค์Šต์œผ๋กœ ํ…์ŠคํŠธ๊ฐ€ ํ†ตํ†ต ํŠ€๋Š” ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๋งŒ๋“ค์–ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค~~!


#1. HTML

๊ฐ๊ฐ์˜ span ํƒœ๊ทธ์— ํ…์ŠคํŠธ๋ฅผ ํ•˜๋‚˜์”ฉ ์ž…๋ ฅํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค!

<h1>
  <span>t</span>
  <span>o</span>
  <span>m</span>
  <span>e</span>
  <span>t</span>
  <span>o</span>
  <span>l</span>
  <span>v</span>
  <span>e</span>
</h1>

#2. CSS

๋‹ค์Œ์€ CSS ์ฝ”๋“œ ์ž…๋‹ˆ๋‹ค!

html, body {
  width: 100%;
  height: 100%;
  background: linear-gradient(140deg, beige 0%, salmon 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}
h1 {
  height: 100px;
}
h1 span {
  font-family: '๊ถ์„œ์ฒด';
  font-size: 80px;
  color: #fff;
  position: relative;
  top: 20px;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 1px 0 #ccc,
               0 2px 0 #ccc,
               0 3px 0 #ccc,
               0 4px 0 #ccc,
               0 5px 0 #ccc,
               0 6px 0 transparent,
               0 7px 0 transparent,
               0 8px 0 transparent,
               0 9px 0 transparent,
               0 10px 10px rgba(0,0,0,0.4);
  animation: bounce 0.3s ease infinite alternate;
}
h1 span:nth-child(2){
  animation-delay: 0.1s;
}
h1 span:nth-child(3){
  animation-delay: 0.2s;
}
h1 span:nth-child(4){
  animation-delay: 0.3s;
}
h1 span:nth-child(5){
  animation-delay: 0.4s;
}
h1 span:nth-child(6){
  animation-delay: 0.5s;
}
h1 span:nth-child(7){
  animation-delay: 0.6s;
}
h1 span:nth-child(8){
  animation-delay: 0.7s;
}
h1 span:nth-child(9){
  animation-delay: 0.8s;
}

@keyframes bounce {
  100%{
    top: -20px;
    text-shadow: 0 1px 0 #ccc,
                 0 2px 0 #ccc,
                 0 3px 0 #ccc,
                 0 4px 0 #ccc,
                 0 5px 0 #ccc,
                 0 6px 0 transparent,
                 0 7px 0 transparent,
                 0 8px 0 transparent,
                 0 9px 0 transparent,
                 0 50px 25px rgba(0,0,0,0.4);
  }
}

#3. ๊ฒฐ๊ณผ๋ณด๊ธฐ

728x90

๋Œ“๊ธ€


Lucky Charms Rainbow
js
html
css