0

First issue: I have been trying to get this right but nothing is working. Just as the page is loaded, i want an image to scale and fade down and sit there. The image is also a link.

The code I have so far that works without any animations is

html---

<a href="index.html"> 
    <img src="images/insandoutslogo.jpg" alt="" class="insandoutslogoimg" /> 
    <p1> Ins and Outs </p1>
</a>

css---

.insandoutslogoimg
{
    width: 210px;
    height: 210px;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -112.5px;
    margin-left: -112.5px;
}

THanks heaps!

4

1 回答 1

1

很难理解这个问题。但也许你看起来像这样:

.insandoutslogoimg {
  width: 210px;
  height: 210px;
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -112.5px;
  margin-left: -112.5px;

  animation: fadeInDown 2s ease;
}

@keyframes fadeInDown {

  0% {
    transform: scale(0);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

CodePen 演示

您还需要浏览器前缀(CodePen 使用 Lea Verou -prefix -free

于 2013-09-14T08:57:39.580 回答