Divided Progress Indicators in Bootstrap 3

Looking to enhance user experience on my webpage by creating a progress bar for data entry. The goal is for users to enter 10 items before proceeding.

The challenge I'm facing is developing a progress bar that accurately reflects the number of items entered versus remaining. Here's an image demonstrating what I want to achieve.

My current attempt involved using Bootstrap's stacked progress bars. However, the issue lies in the fact that the unfilled section appears as a single unbroken region, failing to indicate the individual segments left to complete. You can view the problem in this fiddle.

Below is the code snippet from the fiddle:

<div class="container">
    <div class="progress progress-bar-segmented">
        <div class="progress-bar" style="width: 10%"></div>
        <div class="progress-bar" style="width: 10%"></div>
        <div class="progress-bar" style="width: 10%"></div>
    </div>
</div>

I've scoured the internet for similar examples but haven't found a suitable solution yet. I'm unsure of the specific terminology used for this design - perhaps it could be categorized as a step-wise progress bar?

If anyone has ideas or suggestions on how to tackle this issue, I would greatly appreciate your insights.

Answer №1

If you prefer not to fill the area inside the items proportionally, one suggestion is to create ten empty divs next to each other and apply classes to color them as needed.

Feel free to test by clicking on the Run code snippet below.

.container {
    width: 100%;
}

.item {
    width: 10%;
    border: 1px solid grey;
    background-color: lightgray;
    border-radius: 3px;
    margin-right: 2px;
    float: left;
    display: block;
    height: 20px;
}

.filled {
    background-color: blue !important;
}
<div class="container">
    <div class="item filled"></div>
    <div class="item filled"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
</div>

Only use the bootstrap component mentioned if you specifically require filling the divs in proportional parts. However, for styling purposes, you can always import the necessary styles from bootstrap library.

However, if you are determined to utilize the bootstrap component, there is a workaround available which may not be aesthetically pleasing here.

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

Iterating through children of the target element using the .each() method in jQuery

Currently, I am looping through the elements and extracting the src attribute from the child element. This is the snippet of HTML code that I am working with: <noscript data-alt="super awesome"> <img src="http://farm9.staticflickr.com/8235/85 ...

What is the best way to adjust the height of a Div to be 100%?

I've been struggling to make the .footer and the div .content have a height of 100%. While I know how to get the footer to stick at the bottom, I can't seem to make the content div reach the bottom of the page. Increasing the min-height on the co ...

Connecting HTML pages on two different drives on the same computer: Is it possible?

Is it possible to create hyperlinks between HTML pages located in two different folders on separate drives (for example, one in Drive:C and another in Drive:E) on the same computer? I can navigate up multiple directories and to different folders or subfol ...

The z-index is not functioning properly in terms of layering correctly

Seeking advice on z-index... I'm experimenting with the code and trying to get my id="hidebar" to appear above the "content" and "content-inner" divs. Apologies if this is elementary, but I'm having some trouble =D CSS structure file: body { ...

CSS shimmer effect does not smoothly transition between borders

Currently, I'm diving into a tutorial on YouTube that teaches how to craft a CSS Glowing Border Animation After putting in the effort to replicate the animation, I noticed a glitch that's been bothering me. It seems like there's an abrupt s ...

Retrieve specific data from ajax response after submitting a form

Recently, I built a simple upload form that uses AJAX post to send requests. The data received is then displayed in a bootstrap modal, exactly as I had planned. In the upload.php file, certain parts are responsible for extracting exif data from the upload ...

Unable to change the background color of h1 tag in a ReactJS project

import React from 'react' export default function Home(){ return<div> <h1 className="bg-dark text-white p-3">Home Page</h1> </div> } I am attempting to modify the background color of the h1 tag in my Reac ...

How to verify the parent nodes in a jstree

I have implemented a two state jstree. However, I am encountering an issue where it is not possible to select any other node in relation to a node. My goal is that when I click on a specific node, all of its parent nodes should also be checked. Any assist ...

Utilize HTML to pre-load a font and incorporate it into your CSS styling

It is common knowledge that when we include the following code in our .css file: @font-face { font-family: "Akrobat-Regular"; src: url('/assets/Akrobat-Regular.otf') format("truetype"); } body { color: #1c1c1c ...

utilizing symbols from a vector graphic icon库

There are countless icon images to be found on the internet. Recently, I came across this particular set and now I'm stumped on how to actually utilize them. Despite my efforts to find tutorials online, I have come up short in finding any helpful reso ...

Checkbox option to change background color of table cell

$('#selectall1').click(function(event) { if (this.checked) { $('.first').each(function() { this.checked = true; }); $('.second').each(function() { this.checked = false; }); $('.third&apos ...

Using the Drupal Colorbox module with Internet Explorer

This problem has been driving me crazy! I'm struggling to make Colorbox show the borders correctly in IE7 (and even in IE6, but I'll settle for just IE7 at this point!). You can check out the issue here. When you click on a picture in the galler ...

Creating a mandatory 'Select' dropdown field in Vue.js

Hello, I am a beginner in VueJS and I am trying to make a select element from a drop-down list required. I attempted to add the required attribute as shown in the code below. Any suggestions on how to achieve this? Thanks. <v-select ...

Positioning a secondary div beside a primary div that is centered on the page

As I work on my website, I have a container that encompasses the entire design and is perfectly centered using margin:auto. Now, I am looking to float specific content to the right of this central container in a way that it stays attached to the side reg ...

Overlapping dynamic content causing CSS nested scrollbars to clash at full width of 100%

Displayed below is a layout with two nested divs, both featuring automatic vertical scrolling. Is there a CSS technique available to show the inner scrollbar while maintaining the inner div at 100% width? https://i.stack.imgur.com/HSKHH.png div { ba ...

Materialize CSS dropdown select arrow out of position

Here is a snapshot of the Materialize CSS, which can be viewed at: However, I am encountering an issue where the dropdown arrow appears below the list instead of on the side. I am currently using Django 3. How can I resolve this? Below is the HTML code ...

After a CSS animation, the Div element disappears from view

I recently implemented a CSS3 delayed animation on page load. Everything was working smoothly until I noticed that after the animation finishes, the DIV reverts back to visibility: hidden. .content-left { margin-left: 100px; margin-top: 32px; ...

Improving the style of Google Maps InfoWindows for right-to-left languages

I'm currently working on a Google Maps marker infowindow and trying to adjust the padding specifically for RTL languages. Here's what I've attempted so far: google.maps.event.addListener(marker, 'click', function () { i ...

Guide to importing a JSON file into Vue.js and HTML

I'm a beginner in Vue and not very familiar with HTML I'm attempting to import data from a JSON file into my interface to display it for the user. Below is the structure of the JSON: [ { "Title": "SOFT-STARTER", "Cod&q ...

Comparing scrollIntoView and moveToElement functions

When working with Selenium WebDriver, there are two primary methods to ensure an element is within the visible area: Scrolling into view: ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element); Using moveToElemen ...