Bizarre bouncing dots created with CSS animations

This is the CSS class I created for my Loader:

.loading{
  color:black;
  position:fixed;
  width: 270px;
  height:100px;
  font-size:20px;
  top:0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  transition: 1s ease-out;
  opacity:1;
}



  .loading:after {
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    animation: ellipsis steps(4,end) 900ms infinite;
    content: "\2026"; /* ascii code for the ellipsis character */
    width: 0px;
  }

  @keyframes ellipsis {
    to {
      width: 20px;
    }
  }

  @-webkit-keyframes ellipsis {
    to {
      width: 20px;
    }
  }


.centered{
  vertical-align:middle;
  text-align:center;
  align-items: center;
  justify-content: center;
}

Here's how I use it:

<div class="loading centered">
    Loading your results
</div>

You can observe in this example that the dots are causing the entire label to shift to the left. What adjustments should I make to remedy this issue?

Answer №1

You have successfully adjusted the pseudo element to position: absolute and shifted it to the right (left: 100%)

Check out the updated Plunker here

.loading{
  color:black;
  position:fixed;
  width: 180px;              /* modification made */
  height:100px;
  font-size:20px;
  top:0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  transition: 1s ease-out;
  opacity:1;
}    
  .loading:after {
    overflow: hidden;
    display: inline-block;
    position: absolute;      /* new addition */
    left: 100%;              /* newly added */
    vertical-align: bottom;
    animation: ellipsis steps(4,end) 900ms infinite;
    content: "\2026"; /* using ascii code for the ellipsis character */
    width: 0px;
  }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to incorporate white-space:normal within the text of a jQuery Mobile grid button?

Below is the code for my jQuery Mobile Grid buttons: <div class="ui-grid-b my-breakpoint"> <div class="ui-block-a"><button type="button" data-theme="c"> <img src="res/icon/android/business.png" height="45"><br>Business</ ...

Styling React components with localized CSS files

After diving into a React project built with redux-easy-boilerplate (https://github.com/anorudes/redux-easy-boilerplate/tree/master/src), I found the structure of individual SCSS files for each component quite appealing. As I migrate an older app that uses ...

Is it possible for the background color to change in a sequence every time the page

I'm having trouble figuring out how to create a sequence that changes the background color every time the page is refreshed. I'm comfortable with basic HTML but not so much with JavaScript or CSS. I'm working on a page where I want the backg ...

Exploring the latest features in Bootstrap 4 Alpha and enhancing your

Rumors have it that Bootstrap 4 will make its debut during the year 2016. When duty calls for an upgrade, is a complete re-write truly the best solution? Tackling such a project from Boostrap 2 to 3 was no small feat, and I find myself hesitant to take on ...

How can I style my tables to have different border spacing between the table head and table body?

When it comes to tables, I want to customize the column spacing in a specific way. I need space between columns in the table header but no gaps between columns in the table body. How can I achieve this by including border space only in the thead section? ...

When hovering, the CSS border-bottom should extend

I am looking to create an animated border effect. When hovering over the link, I want the border-bottom to extend seamlessly from left to right. After much searching, I am still unsure what this effect is called. Below is the code I have: .a{ width ...

Is background image alignment responsive?

Ensure to view it at 1680px width for perfect alignment, but resizing the screen may cause alignment issues. Any suggestions on how to resolve this problem? I am attempting to replicate my design from Dribbble shot. Snippet of code. .wrapper { pos ...

Changing the text color of the Vuetify Table header is a simple way to customize the

I am currently working on a Vuetify table with the class condition-table. I have applied the following CSS styling: .condition-table { background-color: #e1f5fe70; } The styling seems to work fine so far. However, when I added this additional CSS: .co ...

Compact looped slideshow

Currently in the process of designing a website and looking to incorporate a unique photo gallery feature. The concept is as follows: The photo gallery will be displayed in a rectangular/box shape. There are a total of 10 photos, with only 7 initially vis ...

Manage the individual style properties for the background images of a single div

I have a DIV that I would like to have 2 or more background images displayed. In the DIV class, I defined a style with two image URLs: .manyImages { background: url(/a1.png), url(/a2.png) no-repeat; } <div class="manyImages"> </div> My ...

What is the best way to style multiple classes within the same element (specifically an ordered list ol

Using CSS counters, I have created various styles for an ordered list <ol> by applying different classes and adjusting the styles accordingly. Now, I want the counters to adjust based on screen size, displaying smaller numbers on smaller screens. To ...

Tips for showcasing unprocessed JSON information on a webpage

Similar Question: JSON pretty print using JavaScript I am looking to present my raw JSON data on an HTML page similar to how JSONView displays it. Here is an example of my raw JSON data: { "hey":"guy", "anumber":243, "anobject":{ "whoa ...

What is the method for ensuring text remains within a square while it is being relocated?

Check out this jsfiddle where you can interact with a moving square: http://jsfiddle.net/helpme128/3kwwo53t/2/ <div ng-app="test" ng-controller="testCtrl"> <div id="container"> <div class="shape" ng-draggable='dragOptions& ...

Inaccurate rendering of border widths on IOS platform

After setting the border width of these input boxes to 1px, it appears that on iOS devices, the top border seems larger than intended (regardless of the browser being used). Interestingly, on any other type of device, the border looks perfectly fine. & ...

Is there a way to create a table with "cells that can be controlled individually" similar to the image provided using HTML and CSS?

I have been searching online for solutions on how to create a table similar to the one in this image, but so far I haven't had much luck. I attempted to use colspan, however, it didn't yield the results I was hoping for. Does anyone have any alt ...

Ways to eliminate white space in bootstrap CSS menu bar

My goal is to create a responsive navigation bar using Bootstrap and customize it to fit my design needs. Although I was able to implement the dropdown on mobile-sized windows, I encountered a margin issue that I couldn't remove on the right side. I ...

CSS Dilemma: Font Refusing to Change

Hey everyone, I'm new to web development and currently building a basic website on my computer. However, I'm facing an issue where the font I want to use is not changing. Both my HTML and CSS files are located in the correct folder and I am confi ...

Is there a distinction between em and percentage measurements and do their defaults have specified definitions?

Both em and percentage are defined in relation to other elements or properties. For example, with text-indent, it is related to the width of the paragraph, while with font size, it is related to the browser's default size. The question arises - wh ...

Utilize Bootstrap to occupy the rest of the available vertical space

Struggling with handling empty space in a Bootstrap grid? Check out the issue I'm facing when the div doesn't fill the entire height. https://i.sstatic.net/zvS7t.png This is the current configuration: <div class="row"> <div class= ...

Wrap the block in a container if the screen size is less than x

I have an image and a text inside it (using bootstrap 5, but that's not important) <div class="carousel-item"> <img src="https://www.tutorialrepublic.com/lib/images/bootstrap-5.0-illustration.png" class=" ...