<!DOCTYPE html>
<html><head><title>어지러워요</title></head>
@keyframes rotate
from
{transform:rotate(0deg);}
to
{transform:rotate(360deg);}
img
{animation-name: rotate; animation-duration:1s;
animation-iteration-count:infinite;}
</style>
<body>
<h3>어지러워요</h3>
<hr>
<img src="1.png" width="90" height:"100">
</body>
</html>
이렇게 적어보았는데,
실습문제 6-(1)이 실행이 되지 않는데, 무엇이 잘못되었는지 알려주시면 감사하겠습니다.
학기말이라서 답이 약간 늦었네요.
코드를 보니 여러 군데가 틀려있습니다.
1. 우선 <style> 태그가 빠져 있습니다. 이것 때문에 브라우저가 스타일을 찾을 수 없었겠지요.
2. @keyframes rotate 뒤에 { 가 있어야 하는데 이것도 빠졌군요. 그리고 역시 img 앞에 }가 있어야 하는데 이것도 빠졌네요.
제가 빠진 것들을 넣어 보았는데 참고하세요.
<!DOCTYPE html>
<html><head><title>어지러워요</title></head>
<style>
@keyframes rotate {
from {transform:rotate(0deg);}
to {transform:rotate(360deg);}
}
img {
animation-name: rotate; animation-duration:1s;
animation-iteration-count:infinite;
}
</style>
<body>
<h3>어지러워요</h3>
<hr>
<img src="1.png" width="90" height:"100">
</body>
</html>
3. 서둘러서 잘 알지 못한채 코딩을 하면 결국 많은 오류가 발생하게 되고 한발자욱도 나가지 못합니다.
잘 안되면 책을 천천히 읽어 충분히 이론을 숙지하면서 하나씩 오류를 찾아가는 것이 좋겠군요