Usually it’s common to show a loader to the users when they must wait something in a web application (an ajax request or a form submit, etc). Gif images were great but using CSS we can avoid the image request, also it’s easier for customize/ maintain and it’s more cool.
Source: CSS Loader