How to create loading spinner in CSS?

Aniket Kudale
1 min readFeb 2, 2020

--

Photo by Kobu Agency on Unsplash

We all have seen animated loading spinners while we wait for the content to get loaded on Apps or Websites.

Today we are going to create one of those. Without further ado lets create one.

We will be using HTML and CSS only.

In HTML

We add a DIV tag with class name ‘spinner’
We add a DIV tag with class name ‘spinner’

In CSS

Adding styles to spinner class.

All the magic is done here in CSS, as you can see we have made the DIV to appear circle by adding border-radius property. We are setting the border to semi-transparent color except one border i.e border-top which serves as loading indicator. Then we use animation to rotate the element

Easy Peasy!

Aniket Kudale

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response