What is the best way to place an image above a step progress bar?

I need assistance with adding an image or icon above each step in the progress bar. I attempted to insert an image tag, but it ended up next to 'step 1', which is not the desired outcome.

.progressbar {
  counter-reset: step;
}
.progressbar li {
  list-style-type: none;
  float: left;
  width: 33.33%;
  position: relative;
  text-align: center;
}
.progressbar li:before {
  content: counter(step);
  counter-increment: step;
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  display: block;
  text-align: center;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  background-color: white;
}
.progressbar li:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #ddd;
  top: 15px;
  left: -50%;
  z-index: -1;
}
.progressbar li:first-child:after {
  content:none;
}
.progressbar li.active {
  color: green;
}
.progressbar li.active:before {
  border-color: #3aac5d;
  background: #3aac5d;
  color: white
}
.progressbar li.active + li:after {
  background-color: green;
}

.container {
  padding: 1px 1px 1px 1px;
  border: 0px solid lightgrey;
  border-radius: 3px;
}
<div class="container">
  <ul class="progressbar">
    <li class="active"> step 1</li>
    <li>step 2</li>
    <li>step 3</li>
  </ul>
</div>

I want the image/icon to be positioned just above each circle, like a location icon on step 1 and a shopping cart on step 2.

UPDATE: I am aiming for a design similar to the one shown in this tutorial video on YouTube.

https://i.sstatic.net/yvNjC.jpg

Answer №1

Are you interested in a design similar to the one below?

.progressbar {
  counter-reset: step;
}
.progressbar li {
  list-style-type: none;
  float: left;
  width: 33.33%;
  position: relative;
  text-align: center;
}
.progressbar li:before {
  content: counter(step);
  counter-increment: step;
  width: 30px;
  height: 30px; 
  border: 1px solid #ddd;
  display: block;
  text-align: center;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  background-color: white;
}

// more CSS code here...

.container {
  padding: 1px 1px 1px 1px;
  border: 0px solid lightgrey;
  border-radius: 3px;
}
<div class="container">
  <ul class="progressbar">
    <li class="active"> step 1</li>
    <li>step 2</li>
    <li>step 3</li>
  </ul>
</div>

Answer №2

Just checking out the Youtube link as you suggested.

<div class="container">
  <ul class="progressbar">
    <li class="active">
      <img src="IMAGE_PATH">
      <p>Step 1</p>
    </li>
    <li>
      <img src="IMAGE_PATH">
      <p>Step 2</p>
    </li>
    <li>
      <img src="IMAGE_PATH">
      <p>Step 3</p>
    </li>
  </ul>
</div>

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

Center flex items along the vertical axis

IMAGE <div className="d-flex align-items-center"> <img src={member.user_profile_image} width="41" height="41" alt="" ...

Formatting dynamically generated HTML using C#

My ASP.NET web forms site has a large menu that is dynamically generated using C# as a string. The HTML code returned looks something like this: <ul><li><a href='default.aspx?param=1&anotherparam=2'>LINK</a></li> ...

Striking a line through the hyperlink tag

I am attempting to create a crossed-out line above the content of an a tag for decorative purposes. The line should stretch across the entire width without intersecting with the actual text within the tag. This is my desired outcome: https://i.sstatic.ne ...

Develop an exclusive "click-once" button for a webpage

Can anyone assist me in creating a "one-time clickable" button to launch my website? I've searched through numerous threads on Stack Overflow but haven't found a solution yet. ...

What steps should I take to repair my jQuery button slider?

I am facing a challenge with creating a carousel of three images in HTML using jQuery. When the user clicks on the "Next" or "Previous" buttons, I want to scroll through the images one by one. However, I am struggling to hide the other images when one is d ...

"Concealing specific choices in Autocomplete with reactjs: A step-by-step guide

I am looking for a way to hide the selected option in a Dropdown menu so that it does not appear in the next dropdown. For example, if "Hockey" is selected in the first dropdown, it should not be displayed in the second dropdown; only "Baseball and badmint ...

Strange outcomes observed with CSS Selector nth-child

When utilizing the CSS nth-child selector, I am encountering some peculiar issues. The HTML structure is as follows: <div class="block feature-callout-c" id="overview"> <div class="row"> <div class="span twelve"> ...

Accessing and manipulating web elements using either XPath or CSS selectors

Having trouble selecting a specific piece of information using xpath or css selector. Error messages keep appearing. Can someone help identify the issue? This snippet is from my code: output = driver.find_element_by_xpath("//td[@class_= 'sku']" ...

Repair the masthead background during overscroll

The Dilemma At the top of my webpage, I have a sleek masthead with a captivating background image that scrolls along with the page. However, there is an issue when users overscroll upwards, causing an undesirable white overflow to appear. To rectify this ...

React, Axios, and the PokeAPI are like a team of explorers navigating an

Trying to enhance my React abilities, I decided to follow this tutorial on creating a list of names using PokeAPI. However, I hit a roadblock at 11.35 into the tutorial while implementing the provided code snippets in both App.js and PokemonList.js: fu ...

Header with h1 formatting

I'm having trouble getting 'by Jackie' to align under the 'Bella' logo without adding excessive space. Does anyone have any suggestions on how to resolve this issue? HTML: <div class="header"> <div class="wrapper"> ...

Inject a snippet of temporary code at the end of the CSS file using JavaScript or JQuery

I am looking to dynamically add temporary CSS code to the end of an external CSS file or modify it using JavaScript or jQuery. For example, let's say my mystyle.css file looks like this: //mystyle.css p{color:red} Now, when a user interacts with the ...

generate a customized synopsis for users without storing any data in the database

In order to provide a summary of the user's choices without saving them to the database, I want to display it in a modal that has already been created. Despite finding some sources online, none of them have worked for me so far. Below is my HTML: &l ...

What is the best way to incorporate code into a page with numerous conflicting CSS styles, without resorting to Scoped CSS?

Struggling to incorporate tab code into a page with conflicting CSS? Even after attempts to edit classes and labels, the original code fights back against the new additions. While scoped CSS seems like the perfect fix, it's not widely supported yet. ...

Utilize a Chrome Content Script to intercept jQuery delegated event handlers and take control

After developing a Chrome extension that intercepts form submissions in specific circumstances, I encountered an issue with a particular website utilizing jQuery's delegate function. My extension is built with raw JavaScript, excluding jQuery to prev ...

Enhancing Blog Navigation with PicoCMS Pagination

After successfully setting up PicoCMS on my website, everything seems to be working well except for the blog pages. I am having issues with the "Older Posts" button not functioning as expected. Unfortunately, I couldn't find any information in the the ...

What could be the reason for my select list not showing up?

Hello fellow developers, I am currently working on creating a dynamic tablerow that allows users to fill in input fields and select options from a list for each cell. While the input fields are functioning properly, I am facing an issue with displaying th ...

Issues with the Diagonal HTML Map functionality

I'm seeking assistance to implement a unique Google Maps Map on my webpage. I have a particular vision in mind - a diagonal map (as pictured below). My initial approach was to create a div, skew it with CSS, place the map inside, and then skew the ma ...

Creating visually appealing websites is made easy with Bootstrap 5's innovative image and

I am working on a Bootstrap 5 website template and I want to add text with a white background in the center of an image. Instead of seeing just a white color over the image, I would like to have a white rectangle with a title and text centered on the imag ...

A fragmented rendering of a gallery featuring a CSS dropdown menu

Hey there! I'm a newbie coder seeking some assistance. Recently, I stumbled upon a tutorial online that taught me how to create a drop-down menu. However, whenever I hover over "Gallery" on my website, things go haywire and the layout gets all messed ...