Moving the line tracking the circle to the lower part of the circle

I'm currently tackling a multi-step progress bar implementation. My challenge right now is figuring out how to position the circle markers representing each step on top of the connecting lines. I've tried using the :after pseudo-element to add the line to each circle, and I even utilized z-index to ensure that the circles always appear on top, but unfortunately, it didn't produce the desired result. Any suggestions or alternative approaches?

For reference, here's the link to the jsfiddle: http://jsfiddle.net/gaqz77qf/1/

.visuallyhidden {
  display: none;
}
.wizard-progress {
  list-style: none;
  list-style-image: none;
  margin: 0;
  padding: 0;
  margin-top: 20px;
  float: left;
  white-space: nowrap;
}
.wizard-progress li {
  float: left;
  text-align: center;
  position: relative;
}
.wizard-progress .step-name {
  display: table-cell;
  height: 32px;
  vertical-align: bottom;
  text-align: center;
  width: 100px;
  z-index: 100;
}
.wizard-progress .step-name-wrapper {
  display: table-cell;
  height: 100%;
  vertical-align: bottom;
}
.wizard-progress .step-num {
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-block;
  margin-top: 10px;
  z-index: 100;
}
.wizard-progress .step-num:after {
  content: "";
  display: block;
  background: #CCC;
  height: 15px;
  width: 85px;
  position: absolute;
  bottom: 5px;
  left: 58px;
  z-index: 0;
}
.wizard-progress li:last-of-type .step-num:after {
  display: none;
}
.wizard-progress .active-step .step-num {
  background-color: #ff0500;
}
<ol class="wizard-progress clearfix">
  <li class="active-step">
    <span class="step-name">
            Foo
        </span>
    <span class="visuallyhidden">Step </span>
    <span class="step-num">1</span>
  </li>
  <li>
    <span class="step-name">Bar</span>
    <span class="visuallyhidden">Step </span>
    <span class="step-num">&hearts;</span>
  </li>
  <li>
    <span class="step-name">Baz</span>
    <span class="visuallyhidden">Step </span>
    <span class="step-num">3</span>
  </li>
  <li>
    <span class="step-name">Quux</span>
    <span class="visuallyhidden">Step </span>
    <span class="step-num">4</span>
  </li>
</ol>

Answer №1

By adjusting the z-index to -1, I was able to position the circle above the bar in your design. This change should align with your expectations:

Line 56:       z-index: -1; 

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

Content editable div causing overflow issues in Internet Explorer

I am having trouble with a content editable div where the text is not wrapping properly. I attempted to use "overflow:scroll" but it only ends up cutting off the text horizontally. https://i.stack.imgur.com/WlMdY.jpg ...

Incorporating CSS Styles in Dompdf Library for Codeigniter

Although I am able to generate a PDF file from the Codeigniter Framework using the Dompdf library, the generated PDF does not retain the styling I applied to the page. How can I ensure that CSS is rendered together with the HTML content in the PDF? The fu ...

Creating expandable and collapsible table sections within an HTML document are made possible using

This is an example of code similar to what I am currently working on. I am trying to create collapsible subsections within a table, where the main headers can be opened separately from the subheaders. The goal is for the initial view of the page to display ...

Designing a website layout for android devices

Could this inquiry receive positive feedback rather than being downvoted? I have conducted thorough research before posting. I've been experimenting with developing a responsive website for practice. It worked well on my computer; every time I adjust ...

Using CSS to Create a Background with RGBA Color and Image

Having an issue with my CSS. I'm trying to create a scrolling background for the left section of my website. The RGBA is currently overlapping the entire page, but I only want it to overlap the background image. The same goes for the gridtile (the ov ...

Highlight the title with a stylish CSS animation effect

I have a challenge with animating div tags once they come into view on the page. Thanks to waypoint.js, I have successfully achieved the 'in viewport' trigger, but now I need help with the animation part. Specifically, I am looking to add a grey ...

Is there a way to use CSS to break one word at the end of a line and move the next word to the next line?

My desired format: _________ Thanks fo|r your answ|er! not the following: _________ Thanks | for your | answer! | also not this: _________ Thanks fo|r your answer! ...

Replace the CSS styling with new code from different files

After downloading a large web template containing numerous CSS and JS files, I have successfully created a visually appealing website. However, there are still some minor details that I wish to modify, such as the font style and colors. The issue arises w ...

Shake up your background with a random twist

Seeking assistance with customizing the Aerial template from HTML5UP. I am interested in selecting a scrolling background randomly from a pool of images. Can someone guide me on how to achieve this? Presently, the background is defined within a code block ...

Implement a cross-browser solution for setting the input width to adjust automatically based on the text content

Is there a way to create a text input box that automatically adjusts its width in all browsers, including IE6 and newer? In the example below, the textbox expands to fit the content "text." Are there any cross-browser solutions for this issue? See demo on ...

How can I customize the color of a date range in the jQuery date picker?

Currently, I am using the following method to set a different color for a specific date range - April 5th to April 7th. You can view it here: http://jsfiddle.net/sickworm/dpvz52tf/ var SelectedDates = {}; SelectedDates[new Date('04/05/2015') ...

If a CSS variable is invalid, it will default to using the SVG fill

In my SVG, there are several rectangles that change their fill color in a gradient effect as they move down the SVG. Users have the option to choose a solid fill color to customize their experience, which replaces the gradient color of the rectangles. I am ...

Click on an image to select four numbers using JavaScript

I have a selection of images representing numbers 1 through 9. When a user clicks on one of these images, I want to save the corresponding number (e.g., if they click on the image with the number 1, I want to save the number 1). However, I only require fou ...

Problem with jQuery expanding the container when clicking "Read More"

I'm working on a script to collapse and expand a div based on click events. The code below is functioning correctly, but the container always starts off expanded when the page loads. I want to reverse this behavior so that the div is collapsed when th ...

Collapsed on Load Vertical Collapsible Panel - Initially hidden panel on page load

Is there a way to load a <div> already collapsed when the page first loads? You can find my progress so far in this JS Fidle. HTML <button id="aa">Toggle it up</button> <div id="test">TEST</div> CSS div { background ...

Trouble with the Ngx-Captcha feature

I am currently utilizing https://www.npmjs.com/package/ngx-captcha/v/11.0.0. <ngx-recaptcha2 #captchaElem [siteKey]="'6Leh1ZIjAAAAAG8g0BuncTRT-VMjh3Y7HblZ9XSZ'" (success)="handleSuccess($event)" [useGlobalDomain]="fals ...

Arranging Bootstrap divs for optimal display on mobile devices

Check out my simple jsfiddle demonstration here. I'm looking for a solution where the image appears above the text on smaller window sizes, instead of dropping below due to the HTML order. Currently, I am considering having duplicate images (one abo ...

What is the best way in JavaScript to target a specific element in a href attribute in order to create Previous and

<li><a href="/chapter-1.html">Ch. 1 - TitleHere</a></li> <li><a href="/chapter-2.html">Ch. 2 - TitleHere</a></li> <li><a href="/chapter-3.html">Ch. 3 - TitleHere</ ...

Achieving Content Alignment Using CSS

I successfully implemented a design on my HTML page that divides it into three sections vertically, with each section having a different background color - white, gray, and black. The backgrounds stretch the full width of the page regardless of screen reso ...

What is the best way to display letter p when hovering over an image?

Even though the issue of overlapping has been addressed before, I am struggling to center the text on top of the image when hovered. I have experimented with z-index, relative and absolute positioning, but I'm still seeking assistance. .flex-conta ...