Animating the background position of a progress bar using CSS3 and Webkit

I am seeking a functional method to animate the background-position property of an HTML5 progress element in webkit/blink.

HTML:

<progress max="100" value="0"></progress>

CSS:

progress[value]::-webkit-progress-bar {
  -webkit-animation: moveBackground 2s steps(30) infinite;
  background-image: repeating-linear-gradient(to right, green 0%, orange 50%, blue 100%);
  background-size: 30rem;
}

@-webkit-keyframes moveBackground
{
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -50rem 0;
  }
}

Fiddle: https://jsfiddle.net/6gekeegg/

However, gecko supports the animation of the background-position property, simple example:

progress[value] {
  ...
}

Answer №1

It is important to prefix the animation property

-moz-animation: rotateImage 2s steps(45) infinite;

example

Answer №2

Update: March 11, 2015:

versions equal to or less than 41 do not seem to support animations for the background-position attribute of progress elements.

I have devised a functional solution using the ::after pseudo-element in :

https://jsfiddle.net/x7urfdev/

Important reminder: does not support the ::after or ::before pseudo-elements on progress elements.

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

inventory of items for which I lack the knowledge to create

Hey, I'm new to the web development scene and there's something I'd like to learn how to create. Here's a list of what I want to make: https://i.sstatic.net/ULW9g.png What is that bar thing called? And how can I make it stay on top w ...

Challenges encountered while using Selenium WebDriver to upload images

I'm having trouble adding an image as a normal attachment to an email (not as an inline image). When inspecting the HTML DOM with Firebug, I noticed there are two elements with xpath //input@type='file', which is due to the presence of two b ...

How can you modify a specific field using a modal form in Django?

Managing a form to track the entry and exit times of individuals in different areas can sometimes lead to discrepancies. For instance, if someone forgets to "leave" an area before entering a new one, a prompt is shown asking for an "estimate" of the time t ...

The navigation bar is positioned with white space above it

Currently working on a website design and facing an issue with adding a clickable button to the Nav-bar. Noticed some white-space above the Nav-bar which is not desired. I had previously posted a similar question but unable to identify the CSS error causi ...

Is there a way to position images alongside input fields using Bootstrap?

Struggling to design a user login page for my webapp, specifically getting the username image and input to display next to each other. It used to work fine, but now they won't align properly. I know it's a mess, anyone spot the issue here? I&apo ...

Executing JavaScript code does not execute CSS code

Having some trouble with my Javascript and CSS. The script is functioning well, but when I use the filtering function, the CSS stops working and only the filtered results are displayed on the HTML page. Looking for advice on how to fix the Javascript. & ...

Scroll the page only when the first radio button is clicked

After selecting a radio button with the ID "yourgoal", a div is displayed on my page. I want the page to scroll to that div only the first time a button in "yourgoal" is clicked. Below is the code I am currently using. However, I do not want the page to sc ...

The Jsoup after function fails to meet expectations

I am facing an issue with a method I have, where the property description is of type "Element" and I am attempting to add another element using the Jsoup.after method. Unfortunately, this results in an error message: Exception in thread "main" java.lang. ...

What is causing the inability of this simple Google Maps link to function properly on a Nexus 7?

Visit this link for Google Maps A client has reported that the link above is causing an error when opening the maps app. The error message reads: "unsupported link. Google Maps can't open this link." This problem is occurring on a Nexus 7 and Samsu ...

Challenge with CSS3 designstyling

After creating a tag, I noticed that there is a white background after the arrow on the right side. .tags { list-style: none; margin: 0; overflow: hidden; padding: 0; } http://jsfiddle.net/eR8Ye/5/ Is there a way to eliminate the white backgro ...

Is there a way to adjust the transparency of specific text when clicking on a different div?

How can I display a line of text when the "Contact Us" button is clicked on a practice website, similar to this: https://i.sstatic.net/MgbYQ.png I have set the current opacity of the submit message to 0 so it is hidden, but is there a way to change its o ...

Exploring Checkboxes in Hypertext Markup Language

Can anyone advise on the proper HTML input attribute to limit user selection in a list of checkboxes? Specifically, I want users to select no more than three out of five checkboxes without using radio buttons. Please provide solutions using only HTML and n ...

Generating an Xpath for the selected element with the help of Javascript or Jquery - here's how!

On my website, I have implemented a click event on an element. When a user clicks on this element, I want to generate the XPath of that particular element starting from either the html or body tag, also known as the Absolute Xpath. For example, if I click ...

My Bootstrap/Flexbox layout is not behaving as anticipated. Can anyone identify any issues in my code?

I'm currently working on a MVC website that features a login/signup form. I have been trying to utilize bootstrap to format the forms. My main goal is to center the entire form on the screen, but so far I have only been successful in centering it on t ...

A method for positioning each pair of <li> elements side by side

My goal is to arrange every pair of li elements next to each other (e.g. 0-9, A-B, C-D, ...). Currently, they are aligned one by one. <ul> <li class="alphabetRow"><a href="#" id="alpha_1" class="alphabet active" >0-9</a></li ...

I have the ability to shift text 50 pixels to the left

My navigation bar is currently aligned to the left, but I'm looking to move the text 50px from the left. Is there a way to achieve this? .navigation { width: 100%; height:35px; background-color: #f1b500; /*f2c255*/ margin-top: 4.4em; } .navig ...

Comment conditional in PHPBB template

PHPBB utilizes conditional statements within their HTML or XHTML. Here is an example snippet: <!-- IF MODERATORS --> <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF --> ...

The benefits of utilizing "native tags" instead of foreignObject in an SVG

As the creator of the stackoverflow-readme-profile project, I dedicated extensive time and effort to crafting a personalized Stackoverflow profile in the form of an SVG image. Utilizing "native svg tags," I meticulously constructed elements such as: < ...

Troubleshooting flow problems in flexbox container for

https://i.stack.imgur.com/ZpVaH.png I have implemented a flexbox-based page layout. The layout consists of two sidebars on the left and right sides, with fixed widths, and a central content panel that dynamically adjusts to fill the remaining space. Howe ...

Using PHP regular expressions to find the final occurrence trailing after the last match in HTML

Looking to analyze a webpage (where the same product price is compared on different stores - each store has a block with its logo, price...) I want to separate each store into a different array element using preg_match_all I am trying to skip the advert ...