LoginSignup
5
4

More than 5 years have passed since last update.

css3で点滅させる

Last updated at Posted at 2015-11-06

チカチカ点滅するものが見当たらなかったので下記リンクを参考に作ってみた。
CSS3: テキストをイルミネーションのように点滅させるアニメーション

.blink_class{
    -webkit-animation:blink 1.0s step-end infinite alternate;
    -moz-animation:blink 1.0s step-end infinite alternate;
    animation:blink 1.0s step-end infinite alternate;
}

/* 点滅 */
@-webkit-keyframes blink{
    21%,40%,61%,80%,100% {opacity:0;}
    0%,20%,41%,60%,81%,99% {opacity:1;}
}
@-moz-keyframes blink{
    21%,40%,61%,80%,100% {opacity:0;}
    0%,20%,41%,60%,81%,99% {opacity:1;}
}
@keyframes blink{
    21%,40%,61%,80%,100% {opacity:0;}
    0%,20%,41%,60%,81%,99% {opacity:1;}
}

もっとゆっくり

@-webkit-keyframes blink{
    34%,66%,100% {opacity:0;}
    0%,33%,67%,99% {opacity:1;}
}
@-moz-keyframes blink{
    34%,66%,100% {opacity:0;}
    0%,33%,67%,99% {opacity:1;}
}
@keyframes blink{
    34%,66%,100% {opacity:0;}
    0%,33%,67%,99% {opacity:1;}
}
5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4