I have simple CS3 animation which is flipping three words vertically.
Now my animation is not very smooth like you can see in my code. Is there any option on how to make it more smooth? Mainly the first text element is not showing smooth. I already tried ease-in-out but it's not better. Also tried changing the percentage of animations but that was only worse and worse.
MY HTML AND CSS CODE:
body {
background: #000;
}
h1 {
font-weight: 900;
font-style: italic;
font-size: 5em;
text-transform: uppercase;
text-align: center;
padding: 40px 0;
color: rgba(255, 255, 255, 1);
}
#flip {
height: 80px;
margin-left: 16px;
overflow: hidden;
}
#flip .flip-wrapper {
display: flex;
}
#flip>div>div {
padding: 4px 12px;
height: 45px;
margin-bottom: 45px;
color: #fff;
display: inline-block;
}
#flip .flip-container {
animation: show 5s linear infinite;
}
#keyframes show {
0% {
margin-top: -260px;
}
5% {
margin-top: -190px;
}
33% {
margin-top: -190px;
}
38% {
margin-top: -100px;
}
66% {
margin-top: -100px;
}
71% {
margin-top: -10px;
}
99.99% {
margin-top: -10px;
}
100% {
margin-top: -260px;
}
}
<h1>
Digital content
<span>
that
<div id=flip>
<div class="flip-container">
<div class="flip-wrapper"><div>works</div></div>
<div class="flip-wrapper"><div>earns</div></div>
<div class="flip-wrapper"><div>tellth</div></div>
</div>
</div>
</span>
</h1>
Try ease-in-out, the animation will have a slow start and a slow end.
#flip .flip-container {
animation: show 12s ease-in-out infinite;
}
You can see and try more examples of animation properties on this page
https://www.w3schools.com/cssref/css3_pr_animation-timing-function.asp
Edit: I'm now confident that this is related to the z-index property of the arrows. If the z-index of the left arrow is higher than the right arrow, the left arrow image will be inserted on the right. If the z-index of the right arrow is higher or equal to the left arrow, the right arrow will be inserted on the right. I still have no idea why this is happening and why it won't just put the images where I tell it to.
Original:
I'm creating an email with a carousel of images that should slide back and forth when the user clicks on arrows to the sides or tabs at the bottom. But I'm seeing some strange behavior in the iOS native mail app and it's making me crazy. When I first receive and open the email, everything works the way it's supposed to. But if I lock my phone or even just minimize the Mail app and reopen it, the arrows will start breaking.
I insert the arrows with a content(url) property on an ::after psuedo-element. The most common error is the right-facing arrow showing up on the left side when all but the first frame is showing. But sometimes it's the first frame that has the wrong arrow and as soon as I change to another frame, the correct one comes back. I also can see the left arrow flickering in before being replaced by the right arrow. Sometimes the top half of the arrow is correct and the bottom half is wrong. It's all very hard to pin down and very frustrating.
I've seen recommendations to add -webkit-backface-visibility: hidden; (which didn't work) and -webkit-perspective: 1000; (which breaks my absolute positioning on the arrows) and -webkit-transform: translateZ(0); (which also breaks my absolute positioning) to the parent.
Here's a gif of what I'm seeing in my app: https://i.imgur.com/OjoTIk9.gifv
Here's my full HTML and CSS:
<style type="text/css">
table {border-spacing:0px !important;}
table, tr, td {width:100% !important;max-width:580px;}
.full-width {
width:100% !important;}
.autoHeight {
height:auto !important;
}
/*** Carousel CSS */
#media screen and (-webkit-min-device-pixel-ratio: 0) {
/* bugfix for Android 4.4 to support e ~ y */
body {
-webkit-animation: bugfix infinite 1s;
}
#-webkit-keyframes bugfix {
from {
padding: 0;
}
to {
padding: 0;
}
}
#supports (position:relative) {
/*.container {
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
}
.container label {position: absolute !important; z-index: 5000 !important;}*/
/* Hide Fallback content first */
.fallback {
display: none;
}
.carousel {
display: block !important;
max-height: none !important;
position: relative;
}
div[class~="aolmail_carousel"] {
display: none !important;
}
div[class~="aolmail_fallback"] {
display: block !important;
max-height: none !important;
position: relative;
}
/*
Selective blocking for clients.
- Samsung (#MessageViewBody) - no absolute positioning
- Comcast/Zimbra (body.MsgBody) - inconsistent CSS support
*/
#MessageViewBody .fallback,
body.MsgBody .fallback {
display: block;
}
#MessageViewBody .carousel,
body.MsgBody .carousel {
display: none !important;
}
input {
display: none;
}
.carousel a {
width: 100%;
display: block;
overflow: hidden;
}
.carousel .car-frames img {
display: block!important;
width: 100% !important;
height: auto !important;
}
.carousel.responsive {
width: 100% !important;
}
.carousel.slide a {
position: absolute;
top: 0px;
left: 0px;
opacity: 1;
width: 100%;
-webkit-animation: slide-anim 12s linear infinite;
}
.carousel.slide a:nth-child(1) {
position: relative;
-webkit-animation-delay: -13s;
}
.carousel.slide a:nth-child(2) {
-webkit-animation-delay: -10s;
}
.carousel.slide a:nth-child(3) {
-webkit-animation-delay: -7s;
}
.carousel.slide a:nth-child(4) {
-webkit-animation-delay: -4s;
}
/* iOS doesn't like negative delay with translates (transform:translateX(100%);) */
/* So we use margin although it is less "smooth" */
#-webkit-keyframes slide-anim {
/* start slide in */
0% {
margin-left: 100%;
}
/* end slide in */
5% {
margin-left: 0%;
}
/* start slide out */
25% {
margin-left: 0%;
}
/* end slide out */
30% {
margin-left: -100%;
}
/* start slide out */
75% {
margin-left: -100%;
}
/* end slide out */
80% {
margin-left: -200%;
}
100% {
margin-left: -200%;
}
/* end slide out */
}
.carousel.slide .car-radio:checked~.car-cont .car-frames {
position: relative;
left: 0px;
top: 0px;
width: 400% !important;
transition: left 1s;
}
.carousel.slide .car-radio2:checked~.car-cont .car-frames {
left: -100%;
}
.carousel.slide .car-radio3:checked~.car-cont .car-frames {
left: -200%;
}
.carousel.slide .car-radio4:checked~.car-cont .car-frames {
left: -300%;
}
.carousel.slide .car-radio:checked~.car-cont a {
width: 25%;
}
.carousel.slide .car-radio:checked~.car-cont a:nth-child(2) {
position: absolute;
left: 25%;
top: 0px;
}
.carousel.slide .car-radio:checked~.car-cont a:nth-child(3) {
position: absolute;
left: 50%;
top: 0px;
}
.carousel.slide .car-radio:checked~.car-cont a:nth-child(4) {
position: absolute;
left: 75%;
top: 0px;
}
/* Navigation arrows */
.carousel .car-ltn {
z-index: 100;
display: none;
width: 15%;
height: 100%;
position: absolute;
background-color: transparent;
top: 0px;
cursor: pointer;
}
.carousel .car-rtn {
z-index: 100;
display: none;
width: 15%;
height: 100%;
position: absolute;
background-color: transparent;
top: 0px;
cursor: pointer;
}
.car-ltn {
left: 0px;
}
.car-rtn {
right: 0px;
}
.carousel .car-ltn::after {
content: url(https://i.imgur.com/CD2FWkH.png) !important;
width: 0;
height: 0;
position: absolute;
top: 40%;
margin-top: -8px;
-webkit-filter: drop-shadow(1px 1.5px 1px rgba(0,0,0,0.4));
}
.carousel .car-rtn::after {
content: url(https://i.imgur.com/BEpuyhp.png) !important;
width: 0;
height: 0;
position: absolute;
top: 40%;
left: 10%;
margin-top: -8px;
-webkit-filter: drop-shadow(1px 1.5px 1px rgba(0,0,0,0.4));
}
.car-ltn::after {
border-right: 0px solid #ffffff;
left: 25%;
}
.car-rtn::after {
border-left: 0px solid #ffffff;
right: 25%;
}
.carousel #car-cbox-support:checked~.car-cont .car-nav-1 {
display: block;
}
.car-radio2:checked~.car-cont .car-controls .car-nav-2,
.car-radio3:checked~.car-cont .car-controls .car-nav-3,
.car-radio4:checked~.car-cont .car-controls .car-nav-4 {
display: block;
}
.carousel .car-radio:checked~.car-cont,
.carousel .car-radio:checked~.car-cont *,
.carousel .car-radio:checked~.car-thumbnails *,
.car-radio:checked~.car-thumbnails .car-thumb::after
{
-webkit-animation: none;
}
/* Thumbnails */
.car-thumbnails {
z-index: 200;
position:absolute !important;
display:block !important;
bottom:0px;
width:100%;
}
.carousel #car-cbox-support:checked~.car-thumbnails {
display: block !important;
text-align: center;
position: relative;
/*background-color: #473729;*/
}
.carousel .car-thumb {
width: 24%;
opacity: 1;
z-index: 100;
cursor: pointer;
display: inline-block;
margin: 0px;
background-color: rgba(255,255,255,0.5);
}
#-webkit-keyframes focus3-anim {
0% {
background-color: rgba(255,188,46,1);
}
25% {
background-color: rgba(255,255,255,0.5);
}
50% {
background-color: rgba(255,255,255,0.5);
}
75% {
background-color: rgba(255,255,255,0.5);
}
100% {
background-color: rgba(255,188,46,1);
}
}
/* to eliminate use of delay */
#-webkit-keyframes focus3-anim-2 {
0% {
background-color: rgba(255,255,255,0.5);
}
25% {
background-color: rgba(255,188,46,1);
}
50% {
background-color: rgba(255,255,255,0.5);
}
75% {
background-color: rgba(255,255,255,0.5);
}
100% {
background-color: rgba(255,255,255,0.5);
}
}
#-webkit-keyframes focus3-anim-3 {
0% {
background-color: rgba(255,255,255,0.5);
}
25% {
background-color: rgba(255,255,255,0.5);
}
50% {
background-color: rgba(255,188,46,1);
}
75% {
background-color: rgba(255,255,255,0.5);
}
100% {
background-color: rgba(255,255,255,0.5);
}
}
#-webkit-keyframes focus3-anim-4 {
0% {
background-color: rgba(255,255,255,0.5);
}
25% {
background-color: rgba(255,255,255,0.5);
}
50% {
background-color: rgba(255,255,255,0.5);
}
75% {
background-color: rgba(255,188,46,1);
}
100% {
background-color: rgba(255,255,255,0.5);
}
}
#media only screen and (max-width:580px) {
.carousel .car-thumb div span {
display:none !important;
}
.carousel .car-thumb div {
width:15px !important;
height:15px !important;
border-radius: 50%;
margin: auto !important;
}
.carousel .car-thumb {
background-color:transparent !important;
}
.carousel .car-thumbnails {
line-height:50px;
width:70%;
left:15%;
}
.car-thumb:nth-child(1) div {
-webkit-animation: focus3-anim 12s ease-in infinite;
}
.car-thumb:nth-child(2) div {
/*-webkit-animation: focus3-anim 15s linear 5s infinite;*/
-webkit-animation: focus3-anim-2 12s ease-in infinite;
}
.car-thumb:nth-child(3) div {
/*-webkit-animation: focus3-anim 15s linear 10s infinite;*/
-webkit-animation: focus3-anim-3 12s ease-in infinite;
}
.car-thumb:nth-child(4) div {
/*-webkit-animation: focus3-anim 15s linear 10s infinite;*/
-webkit-animation: focus3-anim-4 12s ease-in infinite;
}
.car-radio:checked~.car-thumbnails .car-thumb:nth-child(1) {
background-color: rgba(255,255,255,0.5);
}
.car-radio1:checked~.car-thumbnails .car-thumb:nth-child(1) div {
background-color: rgba(255,188,46,1);
}
.car-radio2:checked~.car-thumbnails .car-thumb:nth-child(2) div,
.car-radio3:checked~.car-thumbnails .car-thumb:nth-child(3) div,
.car-radio4:checked~.car-thumbnails .car-thumb:nth-child(4) div {
background-color: rgba(255,188,46,1);
}
}
#media only screen and (min-width:580px) {
.car-thumb-1 {margin-right:3px !important;}
.car-thumb-2 {margin-right:3px !important;}
.car-thumb-3 {margin-right:3px !important;}
.car-thumb:nth-child(1) {
-webkit-animation: focus3-anim 12s ease-in infinite;
}
.car-thumb:nth-child(2) {
/*-webkit-animation: focus3-anim 15s linear 5s infinite;*/
-webkit-animation: focus3-anim-2 12s ease-in infinite;
}
.car-thumb:nth-child(3) {
/*-webkit-animation: focus3-anim 15s linear 10s infinite;*/
-webkit-animation: focus3-anim-3 12s ease-in infinite;
}
.car-thumb:nth-child(4) {
/*-webkit-animation: focus3-anim 15s linear 10s infinite;*/
-webkit-animation: focus3-anim-4 12s ease-in infinite;
}
.car-radio:checked~.car-thumbnails .car-thumb:nth-child(1) {
background-color: rgba(255,255,255,0.5);
}
.car-radio1:checked~.car-thumbnails .car-thumb:nth-child(1) {
background-color: rgba(255,188,46,1);
}
.car-radio2:checked~.car-thumbnails .car-thumb:nth-child(2),
.car-radio3:checked~.car-thumbnails .car-thumb:nth-child(3),
.car-radio4:checked~.car-thumbnails .car-thumb:nth-child(4){
background-color: rgba(255,188,46,1);
}
}
#media only screen and (max-width: 580px) {
.carousel .car-thumb {
width: 15%;
opacity: 1;
z-index: 100;
cursor: pointer;
display: inline-block;
margin: 0px 0px;
}
.carousel .car-thumb div {
background-color:rgba(255,255,255,0.5);
}
}
/* .car-ltn, .car-rtn {
display:none !important;
} */
/* .car-thumbnails {
display:none !important;
}
.carousel .car-thumb {
display:none !important;
} */
}
}
</style>
<table align="center" bgcolor="#ffffff" valign="middle" width="580" margin="auto" cellpadding="0" cellspacing="0" style="width:580px;border-collapse:collapse;margin:auto;background-color:#ffffff;text-align:center;">
<tr>
<td>
<!-- animated carousel -->
<div class="carousel slide responsive" style="overflow:hidden;width:580px;" width="580">
<!--[if !mso]><!-- -->
<input id="car-cbox-support" type="checkbox" checked="" style="display:none!important">
<input name="car-radio" type="radio" id="car1-radio-1" class="car-radio car-radio1" style="display:none!important">
<input name="car-radio" type="radio" id="car1-radio-2" class="car-radio car-radio2" style="display:none!important">
<input name="car-radio" type="radio" id="car1-radio-3" class="car-radio car-radio3" style="display:none!important">
<input name="car-radio" type="radio" id="car1-radio-4" class="car-radio car-radio4" style="display:none!important">
<!--<![endif]-->
<div class="car-cont" style="position:relative;background-color:#ffffff;">
<div class="car-frames">
<!-- Slide 1 Main Image -->
<img class="full-width autoHeight" src="https://i.imgur.com/j4HpeVl.png" style="display:block;" alt="" border="0">
<!-- Slide 2 Main Image -->
<img class="full-width autoHeight" src="https://i.imgur.com/7OdQqhV.png" style="display:block;" alt="" border="0">
<!-- Slide 3 Main Image -->
<img class="full-width autoHeight" src="https://i.imgur.com/g9pLZbr.png" style="display:block;" alt="" border="0">
<!-- Slide 4 Main Image -->
<img class="full-width autoHeight" src="https://i.imgur.com/ewrZxr5.png" style="display:block;" alt="" border="0">
</div>
<div class="car-controls container">
<!--When slide 1 (car-nav-1) is showing, clicking the left arrow should transition to slide 4 (car1-radio-4) -->
<label for="car1-radio-4" class="car-ltn car-nav-1"></label>
<!--When slide 1 (car-nav-1) is showing, clicking the right arrow should transition to slide 2 (car1-radio-2) -->
<label for="car1-radio-2" class="car-rtn car-nav-1"></label>
<!--When slide 2 (car-nav-2) is showing, clicking the left arrow should transition to slide 1 (car1-radio-1) -->
<label for="car1-radio-1" class="car-ltn car-nav-2"></label>
<!--When slide 2 (car-nav-2) is showing, clicking the right arrow should transition to slide 3 (car1-radio-3) -->
<label for="car1-radio-3" class="car-rtn car-nav-2"></label>
<!--When slide 3 (car-nav-3) is showing, clicking the left arrow should transition to slide 2 (car1-radio-2) -->
<label for="car1-radio-2" class="car-ltn car-nav-3"></label>
<!--When slide 3 (car-nav-3) is showing, clicking the right arrow should transition to slide 4 (car1-radio-4) -->
<label for="car1-radio-4" class="car-rtn car-nav-3"></label>
<!--When slide 4 (car-nav-4) is showing, clicking the left arrow should transition to slide 3 (car1-radio-3) -->
<label for="car1-radio-3" class="car-ltn car-nav-4"></label>
<!--When slide 4 (car-nav-4) is showing, clicking the right arrow should transition to slide 1 (car1-radio-1) -->
<label for="car1-radio-1" class="car-rtn car-nav-4"></label>
</div>
</div>
<div class="car-thumbnails" style="display:none;">
<!-- Thumbnail 1 -->
<label for="car1-radio-1" class="car-thumb car-thumb-1"><div valign="middle" style="font-family:'Open Sans', Arial, Helvetica, sans-serif;font-size:20px;font-weight:700;vertical-align:middle;width:100%;height:auto;line-height:75px;color:#ffffff;margin:0px;"><span>red</span></div></label>
<!-- Thumbnail 2 -->
<label for="car1-radio-2" class="car-thumb car-thumb-2"><div valign="middle" style="font-family:'Open Sans', Arial, Helvetica, sans-serif;font-size:20px;font-weight:700;vertical-align:middle;width:100%;height:auto;line-height:75px;color:#ffffff;margin:0px;"><span>blue</span></div></label>
<!-- Thumbnail 3 -->
<label for="car1-radio-3" class="car-thumb car-thumb-3"><div valign="middle" style="font-family:'Open Sans', Arial, Helvetica, sans-serif;font-size:20px;font-weight:700;vertical-align:middle;width:100%;height:auto;line-height:75px;color:#ffffff;margin:0px;"><span>green</span></div></label>
<label for="car1-radio-4" class="car-thumb car-thumb-4"><div valign="middle" style="font-family:'Open Sans', Arial, Helvetica, sans-serif;font-size:20px;font-weight:700;vertical-align:middle;width:100%;height:auto;line-height:75px;color:#ffffff;margin:0px;"><span>yellow</span></div></label>
</div>
</div>
</td>
</tr>
</table>
z-index does not work with the majority of the email clients.
E:after does not work with the majority of email clients.
webkit-animation is only going to work with IOS, Apple mail.
https://www.campaignmonitor.com/css/positioning-display/z-index/
https://www.campaignmonitor.com/css/selectors/after/
https://www.campaignmonitor.com/css/animations/animation/
Good luck.
I ended up fixing it by making the following changes to the CSS:
.carousel .car-rtn {
z-index: 200;
width: 10%;
}
And I also got rid of the drop shadow on the .carousel .car-ltn::after class.
Can I flash a div using only CSS? I would like this div to flash two colors.
.chat-window .msg-container-base .notification-message-unread{
float: right;
font-size: 10px;
color: #666;
background: white;
padding-left: 10px;
}
Here you go:
.notification-message-unread {
float: right;
font-size: 10px;
color: #666;
background: white;
padding-left: 10px;
display: block;
position: relative;
width: 200px;
height: 200px;
background-color: red;
animation: blinker 1s linear infinite;
}
#keyframes blinker {
50% {
background-color: blue;
}
}
<div class="notification-message-unread"></div>
For this you can use CSS keyframe animations.
.box {
height: 500px;
width: 500px;
animation: animationFrames 5s infinite;
}
#keyframes animationFrames{
0% {
background-color: blue;
}
15% {
background-color: red;
}
30% {
background-color: orange;
}
45% {
background-color: purple;
}
60% {
background-color: green;
}
75% {
background-color: pink;
}
100% {
background-color: black;
}
}
<div class="box"></div>
In the .box class I'm using the animation property to link to an animation keyframe called animationFrames. I'm also defining how long I want this animation to play for, in the example above it's 5s and set to infinite so it repeats forever. The keyframe portion sets what CSS you want to apply to the animation at what percent in the animation, for example at 15% of 5 seconds it will turn red.
You can learn more about CSS keyframe animations here and here.
As per your specific example this code should work (I added a height property just so you could see it)
.chat-window {
float: right;
font-size: 10px;
color: #666;
background: white;
padding-left: 10px;
animation: animationFrames 2s infinite;
height: 500px;
}
#keyframes animationFrames{
50% {
background-color: orange;
}
}
<div class="chat-window"></div>
I am new to CSS3, so please ignore if you find this question silly.
I am working on animation, in which I have 4 list items, I need to move these list items upwards infinite times, and when one rotation completes, It goes back downwards and then starts animation but I need it continue from that point.
And second thing is I need to stop list item for 4 seconds, basically its a news ticker so i need like this one, I have tried and develop something but not what I want.
Here is my code:
HTML
<div class="news">
<ul>
<li>1111</li>
<li>2222</li>
<li>3333</li>
<li>4444</li>
</ul>
</div>
CSS3
#keyframes ticker {
0% {
margin-top: 0
}
25% {
margin-top: -30px
}
50% {
margin-top: -60px
}
75% {
margin-top: -90px
}
100% {
margin-top: 0
}
}
.news {
width: 350px;
height: 32px;
overflow: hidden;
-webkit-user-select: none;
}
.news ul {
width: 350px;
padding-left: 10px;
animation: ticker 10s infinite;
-webkit-user-select: none;
}
.news ul li {
line-height: 29px;
list-style: none;
font-size: 10pt;
}
.news ul:hover {
animation-play-state: paused
}
.news span:hover+ul {
animation-play-state: paused
}
I have added it to the CodePen so that you can have better idea.
any suggestion in this will be really helpful !!
I have changed your way to handle the animation.
Now, I am animating each element separately, but reusing the same animation and setting different delays
#keyframes ticker {
0% {
transform: translateY(100%);
}
5%,
25% {
transform: translateY(0%);
}
30%,
100% {
transform: translateY(-100%);
}
}
.news {
width: 350px;
height: 32px;
overflow: hidden;
border: solid 1px green;
position: relative;
}
.news ul {
width: 350px;
padding-left: 10px;
}
.news li {
position: absolute;
top: 0px;
line-height: 29px;
list-style: none;
font-size: 10pt;
animation: ticker 8s infinite linear;
}
.news ul:hover {
animation-play-state: paused
}
.news li:nth-child(4) {
animation-delay: -2s;
}
.news li:nth-child(3) {
animation-delay: -4s;
}
.news li:nth-child(2) {
animation-delay: -6s;
}
<div class="news">
<ul>
<li>1111</li>
<li>2222</li>
<li>3333</li>
<li>4444</li>
</ul>
</div>
I need to have span with text aligned in the center.
Previously I have used line-height for this purpose, but in this case the text for some items are longer and this doesn't work any more.
JSFiddle: http://jsfiddle.net/4jSdu/
HTML:
<ul>
<li><a><span>Short</span></a>
</li>
<li><a><span>Why Should I Monitor?</span></a>
</li>
</ul>
CSS:
ul {
position: relative;
overflow: hidden;
}
span {
background-color: rgba(216, 25, 11, 0.75);
display: block;
height: 70px;
line-height: 70px;
width: 135px;
color: black;
text-align: center;
/*margin: auto 0;*/
font-weight: bold;
font-size: 15px;
position: absolute;
bottom: 14px;
}
li, a {
width: 135px;
height: 100px;
display: inline-block;
}
EDIT:
I want to note that span element has value bottom: 14px. THere is also animate effect on this span. when page loads span has value bottom: -70px (container has overlfow: hidden,s o this span is not seen) and then it appears (using .animate) and goes to bottom: 14px. So the sollution should consider this.
I cannot get this animate effect working in jsfiddle (http://jsfiddle.net/pr5cL/), but it works on my page that is locally created.
$("ul li:not(.img_active)").mouseenter(function() {
$(this).find("span").css("bottom","-55px");
$(this).find("span").animate({bottom:15},500);
}).mouseleave(function(){
$(this).find("span").animate({bottom:-70},500);
});
Here is link: http://www.sheerdigitaltest.net/janus/
Something like this maybe?
span {
display: inline-block;
line-height:1.25;
vertical-align:middle;
width: 135px;
color: black;
text-align: center;
font-weight: bold;
font-size: 15px;
}
a {
background-color: rgba(216, 25, 11, 0.75);
height: 70px;
line-height: 70px;
font-size:0;
overflow:hidden;
}
li, a {
width: 135px;
display: inline-block;
vertical-align:top;
}
span {
-webkit-animation: slidein 2s ; /* Safari 4+ */
-moz-animation: slidein 2s ; /* Fx 5+ */
-o-animation: slidein 2s ; /* Opera 12+ */
animation: slidein 2s ; /* IE 10+ */
}
#-webkit-keyframes slidein {
0% { margin-top: 70px; }
100% { margin-top: 0; }
}
#-moz-keyframes slidein {
0% { margin-top: 70px; }
100% { margin-top: 0; }
}
#-o-keyframes slidein {
0% { margin-top: 70px; }
100% { margin-top: 0; }
}
#keyframes slidein {
0% { margin-top: 70px; }
100% { margin-top: 0; }
}
Jsfiddle
No IE7 or earlier support. Animation support as per comments.