小编use*_*458的帖子

从左侧CSS动画中滑入

我想制作一个简单的动画,当页面加载时,我的徽标应该从框的左侧到右侧动画.我尝试了很多版本,但还没有成功.

HTML

<body>

<div>
<img src="logo.png" alt="logo" style="width:170px;height:120px;">
</div>
</body>
Run Code Online (Sandbox Code Playgroud)

CSS

div
{
 width:640px;
 height:175px;
 background:blue;
 -webkit-transition: all 1s ease-in-out;
 -moz-transition: all 1s ease-in-out;
 -o-transition: all 1s ease-in-out;
 -ms-transition: all 1s ease-in-out;
 position:absolute;
}
div img
{
 -webkit-transform: translate(3em,0);
 -moz-transform: translate(3em,0);
 -o-transform: translate(3em,0);
 -ms-transform: translate(3em,0);
}
Run Code Online (Sandbox Code Playgroud)

html css css-animations

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

css ×1

css-animations ×1

html ×1