Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3991618
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:38:15+00:00 2026-05-20T06:38:15+00:00

I am using css to create a gantt-chart style progress bar. It consists of

  • 0

I am using css to create a “gantt-chart” style progress bar.

It consists of an empty progress bar, inside which is a green bar which represents expected progress. On top of this should be another (thinner) black bar which represents actual progress.

The “actual” and “expected” bars are independent – i.e. Actual could be more or less than expected, so I can’t just nest the Actual bar inside the div for Expected.

I want to have a number of these little progress bars, in a GridView or Repeater, so I can’t use position absolute.

How can I get the z-index to work so the Actual bar sits “on top” of the actual bar?

The CSS I have is:

div.progressBarEmpty
{
    height:11px;
    background-color:Silver;
    border: 1px solid black;
    font-size: 0.1em
}

div.progressBarGreen
{
    position:absolute;
    top:0;left:0;
    height:11px;
    background-color:#00ff33;
    border-right: 1px solid black;
    font-size: 0.1em
    z-index:0;

}

div.progressBarActual
{
    position:absolute;
    top:3;left:0;
    height:5px;
    background-color:black;
    border-style: none;
    font-size: 0.1em
    z-index:1;
}

And the html:

<div class="progressBarEmpty" style="width:100px">
    <div class="progressBarGreen" style="width:40%" > </div>
    <div class="progressBarActual" style="width:80%"> </div>
</div>

(Just to be clear, the “progressBarActual” div should be 80% of the width of the “progressBarEmpty” div, not the “progressBarGreen”)

EDIT

Here’s a mockup of what I’m after.

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:38:16+00:00Added an answer on May 20, 2026 at 6:38 am

    Live Demo (updated)

    The only change from my last demo:

    • I changed top: 3 to top: 3px.
    • See here for why that was required: (in short, you forgot the px)
      absolute positioning not working with XHTML?

    Live Demo

    Add position: relative to div.progressBarEmpty?

    I’m not entirely sure what it’s supposed to look like, but it does now look vaguely like a Gantt chart.

    If this isn’t quite right (as I suspect is the case), it’s probably just a matter of adding a few more properties, so let me know what’s wrong with it.

    See:

    • http://css-tricks.com/absolute-positioning-inside-relative-positioning/
    • http://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a horizontal 100% stacked bar graph using HTML and CSS.
What is the best way (using HTML/CSS) to create an iTunes-style layout with the
How can I create rounded corners using CSS?
I want to create a toggle button in html using css. I want it
I'm having a problem using CSS's display:inline property with the list-style-image: property on <li>
I'm using CSS to create a header graphic: #header { height:125px; background:url(/Content/images/header_footer.jpg) -0 0
I am using CSS to create a 3-column page layout with header and footer.
Does anyone know good example of using CSS to create rounded corner box where:
I am trying to create a button using CSS Gradients plus a icon that
How to create a rounded corner background box using CSS?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.