Bootstrap - Progress Bar Display

I have a mobile application that is built using Bootstrap 3. I am currently working on creating a responsive progress indicator for the app. This indicator will consist of three to five steps, each showing an icon, step name, and status. On mobile devices, I want the indicator to display like this:

o  Step 1
|  completed monday
|
o  Step 2
|  in progress
|
o  Step 3
   to be done

For screens larger than phones, I would like the indicator to appear as follows:

        o----------------o---------------o
     Step 1            step 2          step 3
completed Monday     in progress     to be done

To achieve this layout, I have implemented the following code, which can be viewed on this bootply.

<div class="row">
  <div class="col-xs-12">
    <ul class="list-unstyled"> 
      <li>
        <i class="fa fa-circle"></i>
        Step 1<br>
          <span class="text-muted">completed monday</span>
      </li>
      <li>
        <i class="fa fa-bullseye"></i>
        Step 2<br>
        <span class="text-muted">in progress</span>
      </li>
      <li>
        <i class="fa fa-circle-o"></i>
        <span class="text-muted">to be done</span>
      </li>
    </ul>
  </div>
</div>

I am struggling to find a way to add the lines between the circles in the desktop view. Is there a way to achieve this using Bootstrap or CSS? If so, could someone please provide guidance on how to do this?

Thank you!

Answer №1

I have implemented a basic table structure in your HTML code with a horizontal layout:

<div class="row">
  <div class="col-xs-12">
    <ul class="list-unstyled"> 
      <table>
        <tr>
          <td>
            <li>
              <i class="fa fa-circle"></i>
              <span>-----------------------------</span>
              <br>
              Step 1
              <br>
              <span class="text-muted">completed Monday</span>
            </li>
          </td>
          <td>
            <li>
              <i class="fa fa-bullseye"></i>
              <span>-----------------------------</span>
              <br>
              Step 2
              <br>
              <span class="text-muted">in progress</span>
            </li>
          </td>
          <td>
            <li>
              <i class="fa fa-circle-o"></i><br>

              Step 3<br>
              <span class="text-muted">to be done</span>

            </li>
          </td>
        </tr> 
      </table>
    </ul>
  </div>
</div>

Now, for the vertical version:

We have added some CSS:

.vertical_line{height:150px; width:1px;background:#000; margin-left:5px;}

And the corresponding HTML structure:

<div class="row">
  <div class="col-xs-12">
    <ul class="list-unstyled"> 
      <li>
        <i class="fa fa-circle"></i>
        Step 1 &nbsp; -
        <span class="text-muted">completed Monday</span>
        <div class="vertical_line"></div>
      </li>
      <li>
        <i class="fa fa-bullseye"></i>
        Step 2 &nbsp; -
        <span class="text-muted">in progress</span>
        <div class="vertical_line"></div>
      </li>
      <li>
        <i class="fa fa-circle-o"></i>
        <span class="text-muted">to be done</span>
      </li>
    </ul>
  </div>
</div>

You also have the option to customize the horizontal layout to match the CSS used in the vertical version.

Answer №2

After taking inspiration from @apollo's solution, I made a simple change to the ul class.

Instead of using <ul class="list-unstyled">, I decided to use <ul class="list-inline">

Check out the JsFiddle link that I created for you.

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

Is it possible to shift the div inline-block using the CSS :after selector?

I'm looking to adjust the placement of the disk icon so that it aligns more with the baseline of the text without increasing the vertical space between lines. Below is the CSS code I've worked on so far: .openPage:after { content: ' &a ...

Hover effect not displaying upon mouse exit

I am working on a feature where a series of images change when hovered over, with a div animating as an overlay on the image. Here is the code snippet: // hiding overlays initially $(".mini-shop .item .image a div").hide(); // toggling overlay and second ...

Locate the final flexbox in the initial row and the initial flexbox in the concluding row

How can I identify the last element of the first row and the first element of the last row in the given code to make it round from all corners? It should be noted that the column number will vary as well as the last element of the first row and first eleme ...

The thickness of an SVG line increases as it is rotated

I am working with multiple straight lines and have specified the stroke-width as 4. However, when I attempt to rotate them, the lines appear thicker than expected. Additionally, setting a negative value, such as <path d="M0 -10 20 0" stroke-width="4" st ...

Issue with Firefox not entering FullScreen when using the userChrome.css file

1) Below is a screenshot of my customized Firefox interface. After tweaking my userchrome.css file to remove tabs, I noticed a large empty space at the bottom of the browser window that I cannot seem to get rid of. Despite trying various solutions, I have ...

How can I create a responsive design for my div elements?

I am facing an issue with responsiveness in my div container. Inside the square-shaped frame, I have a h2 tag that does not adjust properly when viewed on different devices such as mobile and browsers. Despite setting up media queries to make it responsive ...

Incorporate the Coreui admin bootstrap template into a Symfony project

I am currently working on implementing the CoreUi Admin Bootstrap template into my first Symfony project. However, I have encountered some issues. Firstly, the sidebar is not functioning properly and I am unable to minimize it. In addition, there seems t ...

The way images appear can vary between desktop and mobile devices

I am in the process of creating a photography website with a simple goal of displaying images down the page one after another. However, I am encountering issues with uniform display across various desktop and mobile platforms. The site appears perfect on i ...

CSS - Problem with background image appearing stretched on Samsung mobile devices

Is the Samsung default "Internet Browser" based on another build? It seems to have trouble displaying stretched background images correctly, unlike desktop browsers or Chrome for mobile. Here is the CSS and HTML I am using: #bk_img { height:100%; ...

Customize the List Box Appearance for a Specific HTML Item (Option)

I am working on achieving a specific behavior. When using a listBox (or comboBox), the first element (such as "choose one") should have a unique style. Here is an example of code to test: <style type="text/css"> .testX {font-style: italic;} </ ...

What is the best way to position a title and subheading alongside an image?

I am currently working on developing a blog using php and html to enhance my coding skills. On my website, I have a special category where I display posts, the number of which can vary. Each post is composed of a title, a subheading, and a placeholder div ...

Viewing content on a mobile device and using the scrolltop

I am working on a website that needs to be mobile-friendly. With the release of iOS 7, I wanted to achieve a depth and blurry effect. I used an iframe with a CSS3 filter applied to it and made it scroll along with the page using jQuery. Everything looks go ...

Display a persistent bar on the page until the user reaches a specified <div> element through scrolling

Looking to implement a sticky bar at the bottom of my page that fades out once the user scrolls to a specific div and then fades back in when scrolling up and the div is out of view. This bar should only appear if the user's screen size is not large ...

What is the best way to create a unique shadow effect for a container in Flutter?

I am facing a challenge with my screen layout that uses GridView.builder with crossAxisCount: 3. In the itemBuilder, I am returning a Container with shadows on the left, right, and bottom, but so far, I have not been able to achieve the desired outcome. H ...

Tips for avoiding cropped images on mobile websites:

I recently created a website that looks perfect on desktop but appears cropped on mobile devices. The site in question is doc.awsri.com Here are the images causing the issue: https://i.stack.imgur.com/eRJXU.png The problem arises when viewing it on a ph ...

Discover the way to create an HTML button with a mesmerizing transparent effect

For my website creation using Dreamweaver, I came up with the idea of utilizing Photoshop to design backgrounds. The reasoning behind this choice was that if I needed to modify button names at any point, I could simply edit the code and make the necessary ...

Placing a crimson asterisk beside the input field within Bootstrap

Trying to insert a red * at the end of my input field using bootstrap, but all my attempts so far have been unsuccessful. Is there a way to align the Currently experiencing this issue: https://i.stack.imgur.com/61pzb.png Code snippet: .required-after ...

CSS bundling may cause rendering issues, but it functions properly when written directly on the page

When I attempt to link the CSS file within the head or put it in a bundle, it won't render properly. However, if I use inline styles, everything works fine. The application is running locally with debug set to true on Web.config - <compilation debu ...

Image displayed in tooltip when hovering over

I have been experimenting with displaying an image in a tooltip when hovering over it. I came across a fantastic solution that suits my needs: Codepen CSS: @import "compass"; * { box-sizing: border-box; } .tooltip { position: relative; border-bo ...

Achieving horizontal scrolling for tables without using div wrappers

Whenever the width of tables in my articles exceeds the available space in the webpage layout, I wanted to enable horizontal scrolling. Despite trying to accomplish this with CSS alone, I was unsuccessful. As a result, I resorted to enclosing everything i ...