CSS 애니 기초 질문

CSS 애니 기초 질문

QA

CSS 애니 기초 질문

본문

CSS 애니메이션은 이번에 처음 들여다 보게 됩니다. 아래 코드로 짰을때 마우스 갖다 댔을때 shine 효과가 납니다. 이거를 그냥 3s 간격으로 무한히 shine이 돌아가게 하려면 어떻게 해야 하죠? before, after 먹이고 infinite 를 해야 하는건지요. ㅠㅠ

 

html

 

<div class="logo"><span class="shine"></div> 

 

 

CSS


.logo {

display: block;

  width: 256px;

height: 256px;

background: url("http://www.w3.org/html/logo/downloads/HTML5_Badge_256.png") 0 0 no-repeat;

}

 

.shine {

  width: 256px;

height: 256px;

display: block;

background: url("http://i.imgur.com/n1CetrS.png") -256px 0 no-repeat;

  -webkit-transition: background 0s linear;

  -moz-transition: background 0s linear;

  -ms-transition: background 0s linear;

  -o-transition: background 0s linear;

}

 

.shine:hover {

background-position: 256px 0px;

  -webkit-transition: background 1s ease;

  -moz-transition: background 1s ease-out;

  -ms-transition: background 1s ease-out;

  -o-transition: background 1s ease-out;

 

}

 

 

이 질문에 댓글 쓰기 :

답변 2


.shine {
  width: 256px;
	height: 256px;
	display: block;
	background: url("http://i.imgur.com/n1CetrS.png") -256px 0 no-repeat;
  animation-name: shining;
  animation-duration: 1s;
  animation-iteration-count: infinite;
}
@keyframes shining {
    0% {
        background-position: -256px 0px;
    }
    100% {
        background-position: 256px 0px;
    }
}

css3 animation 을 이용하세요.

https://www.w3schools.com/css/css3_animations.asp 

 

 

답변을 작성하시기 전에 로그인 해주세요.
전체 23
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT