Is there any way to animate an ellipsis with CSS animations

0 votes

I'm trying to make an ellipsis animate, and I was wondering if CSS animations could do it...

So it might be like

Loading...
Loading..
Loading.
Loading...
Loading..

And basically just continue like that. Any ideas?

May 26, 2022 in CSS by Edureka
• 13,620 points
1,205 views

1 answer to this question.

0 votes

You might try to time each ellipsis character using the animation-delay parameter. In this scenario, I've placed each ellipsis character in its own span class> so that I can animate them independently.

I produced a demo that isn't great, but it shows what I mean.

The code from my example:

HTML

Loading<span class="one">.</span><span class="two">.</span><span class="three">.</span>​

CSS

.one {
    opacity: 0;
    -webkit-animation: dot 1.3s infinite;
    -webkit-animation-delay: 0.0s;
    animation: dot 1.3s infinite;
    animation-delay: 0.0s;
}

.two {
    opacity: 0;
    -webkit-animation: dot 1.3s infinite;
    -webkit-animation-delay: 0.2s;
    animation: dot 1.3s infinite;
    animation-delay: 0.2s;
}

.three {
    opacity: 0;
    -webkit-animation: dot 1.3s infinite;
    -webkit-animation-delay: 0.3s;
    animation: dot 1.3s infinite;
    animation-delay: 0.3s;
}

@-webkit-keyframes dot {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes dot {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
answered May 27, 2022 by Edureka
• 12,690 points

Related Questions In CSS

0 votes
0 answers

Is there a way to link in a stylesheet where the extension is not .css?

When I dynamically connect in the CSS ...READ MORE

Aug 8, 2022 in CSS by Edureka
• 13,620 points
1,208 views
0 votes
0 answers
0 votes
0 answers

How to position text over an image with CSS

How can I use CSS to center ...READ MORE

Jul 11, 2022 in CSS by Edureka
• 13,620 points
641 views
0 votes
0 answers

Is it possible with CSS to make text's color fade between two colors?

In the following design, I want to ...READ MORE

Aug 5, 2022 in CSS by Edureka
• 13,620 points
750 views
0 votes
0 answers

Looping Animation of text color change using CSS3

I have text that I want to ...READ MORE

Jun 22, 2022 in CSS by Edureka
• 13,620 points
1,332 views
0 votes
0 answers

Loading image using CSS animation VS loading using GIF image

I ran the following tests to see ...READ MORE

Jul 6, 2022 in CSS by Edureka
• 13,620 points
801 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,540 views
0 votes
1 answer

Is there any way to colorize a white PNG image with CSS only?

Filters can be used with -webkit-filter and ...READ MORE

answered May 27, 2022 in CSS by Edureka
• 12,690 points
1,954 views
0 votes
1 answer

What is the proper way to display a logo with CSS?

An <img> element is the proper way ...READ MORE

answered Jun 10, 2022 in CSS by Edureka
• 12,690 points
743 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP