$type=carousel$cols=3$cate=0$date=1

Animating an element using CSS3

Animation is a fun process and CSS gives the ability to do this fun stuff. Let us see an example by animating an element using CSS3. Below...

Animation is a fun process and CSS gives the ability to do this fun stuff. Let us see an example by animating an element using CSS3. Below is an example code

<head>
<style>
div {
   position:absolute;
   top:10px;
   height:100px;
   width:100px;
   border:2px solid black;
  }

div#box-1 {
  background:green;
  left:30px;
  z-index:1;
  }

div#box-2 {
  background:red;
  left:500px;
  z-index:1;
  background-color: red;
  }

div#box-3 {
  background-color:blue;
  left:30px;
  border-radius:65px;
  z-index:2;
  }

@-ms-keyframes slide {
  from { left:30px } to { left:500px }}
@-moz-keyframes slide {
  from { left:30px } to { left:500px }}
@-webkit-keyframes slide {
  from { left:30px } to { left:500px }}
@-o-keyframes slide {
  from { left:30px } to { left:500px }}
@keyframes slide {
  from { left:30px } to { left:500px }}

  div#box-3 {
-ms-animation:slide 2s alternate infinite;
-moz-animation:slide 2s alternate infinite;
-webkit-animation:slide 2s alternate infinite;
-o-animation:slide 2s alternate infinite;
animation :slide 2s alternate infinite;

  }

</style>
</head>

<body>
<div id="box-1">A</div>
<div id="box-2">B</div>
<div id="box-3"></div>
</body>

</html>

See the Result:

A B









END...

COMMENTS

Name

css,17,html,7,php,2,python,1,tech,18,
ltr
item
iWriteLess Tech Blog: Animating an element using CSS3
Animating an element using CSS3
iWriteLess Tech Blog
http://www.iwriteless.com/2015/11/animating-element-using-css3.html
http://www.iwriteless.com/
http://www.iwriteless.com/
http://www.iwriteless.com/2015/11/animating-element-using-css3.html
true
2724151228810149585
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy