Challenges encountered with progress bars

Currently, I am working on an Angular app and implementing a progress bar using Angular. However, I have encountered two issues with my progress bar that need to be addressed.

  1. The fourth section of web development is titled "from end," and I would like it to align straight just like the first section.

  2. The text inside the boxes is appearing one after the other in separate lines. I aim to have them displayed in a single line simultaneously.

Can anyone provide guidance on how to resolve these issues?

.wrap {
  width: 100%;
  height: 30px;
  z-index: -2;
  white-space: nowrap;
  overflow: hidden;
}

.wrap div:first-child {
  margin-left: -2%;
}

.progress {
  margin: 0;
  margin-left: 0.5%;
  height: 30px;
  width: 25%;
  position: relative;
  display: inline-block;
  text-align: center;
  line-height: 30px;
  transition: all 0.8s;
}

.progress:before,
.progress:after {
  content: "";
  position: absolute;
  transition: all 0.8s;
  z-index: -1;
}

.progress:before {
  height: 50%;
  width: 100%;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.2);
  -webkit-transform: skew(45deg);
  -moz-transform: skew(45deg);
  transform: skew(45deg);
}

.progress:after {
  height: 50%;
  width: 100%;
  top: 50%;
  left: 0;
  background: rgba(0, 0, 0, 0.2);
  -webkit-transform: skew(-45deg);
  -moz-transform: skew(-45deg);
  transform: skew(-45deg);
}

.progress:hover:before,
.progress:hover:after {
  background: tomato;
}
<div class="wrap">
  <div class="progress">
    <div>MyData</div>
    <div>My Status</div>
  </div>
  <div class="progress">
    <div>MyData</div>
    <div>My Status</div>
  </div>
  <div class="progress">
    <div>MyData</div>
    <div>My Status</div>
  </div>
  <div class="progress">
    <div>MyData</div>
    <div>My Status</div>
  </div>
</div>

Answer â„–1

By organizing each label in a separate div element, you have the option to utilize flex layout on the parent container. Alternatively, you could combine both labels within a single div. I'll showcase how to implement both methods below.

.wrap {
  width: 100%;
  height: 30px;
  z-index: -2;
  white-space: nowrap;
  overflow: hidden;
}

.wrap div:first-child {
  margin-left: -2%;
}

.progress {
  margin: 0;
  margin-left: 0.5%;
  height: 30px;
  width: 25%;
  position: relative;
  display: inline-flex;    /* updated */
  justify-content: center; /* new */
  gap: 8px;                /* new */
  text-align: center;
  line-height: 30px;
  transition: all 0.8s;
}

.progress:before,
.progress:after {
  content: "";
  position: absolute;
  transition: all 0.8s;
  z-index: -1;
}

.progress:before {
  height: 50%;
  width: 100%;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.2);
  transform: skew(45deg);
}

.progress:after {
  height: 50%;
  width: 100%;
  top: 50%;
  left: 0;
  background: rgba(0, 0, 0, 0.2);
  -webkit-transform: skew(-45deg);
  -moz-transform: skew(-45deg);
  transform: skew(-45deg);
}

.progress:hover:before,
.progress:hover:after {
  background: tomato;
}
<div class="wrap">
  <div class="progress">
    <div>MyData</div>
    <div>My Status</div>
  </div>
  <div class="progress">
    <div>MyData</div>
    <div>My Status</div>
  </div>
  <div class="progress">
    <div>MyData My Status</div>
  </div>
  <div class="progress">
    <div>MyData My Status</div>
  </div>
</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

Using Two JavaScript Functions with Identical Names in One HTML File

I am currently facing an issue with a function where the data is retrieved from the getValue() function. The following code snippet is a fragment. grid.js function gridLoadComplete(){ var data = getValue(); } Take into account the following H ...

Positioned in the center of the screen is an IFrame that is centered inside a div

How can I center an iframe inside a div in the middle of the screen? I've tried adding margin: 0 auto to #iframe but it didn't work. What am I missing here? Any help would be appreciated. <head> <title></title> <li ...

Obtain the href using a combination of xpath and id

I need to extract the href links for 9 search results from this specific website. The xpath and selectors for the first, second, and third items are as follows: '//*[@id="search-results"]/div[4]/div/ctl:cache/div[3]/div[1]/div/div[2]/div[2]/div[2]/p[ ...

Is it possible to integrate a Twitter bootstrap theme into a Rails 4 application if the Vendor/assets directory is missing?

My goal is to integrate a theme from wrapbootstrap.com into my rails 4.1 application. After creating a new app with rails 4 scaffolding, I proceeded to extract the downloaded zip directory which contains 4 directories and an index.html file. I then placed ...

Transforming the hue of a radio-button

When it comes to the default CSS code for radio buttons, they appear gray when unselected and blue when selected: https://i.stack.imgur.com/hsazr.png However, I have a specific requirement for them to be black in both states. In order to achieve this, I ...

Alter the app's entire background color in React.js with a button click

I am facing an issue with changing the background color of my entire React App when a button is clicked. Currently, I am able to change the color of the button itself but not the background. I have imported the App.css file into my project and I am looking ...

Are you tuned in to the Bootstrap collapse events switcheroo?

I created a customized Bootstrap 5 accordion with the following structure: <div class="accordion" id="my_accordion"> <div class="accordion-item"> <h2 class="accordion-header" id="heading_bar ...

Show a hidden div element when selecting an option from a dropdown menu

A task at hand requires the creation of a function that will dynamically display certain parts of a form based on user selection. For instance, if 'Pizza' is chosen, then div #section2 containing questions related to pizza should be revealed. Pr ...

Is there a way to customize the default settings for a blueprint’s menu item?

https://i.sstatic.net/aNeJY.jpg In my react project, I implemented the Menu using MenuItem from '@blueprintjs/core'. The issue I encountered is that when hovering over a Menu item with children, they open from the right side. Is there a way to m ...

The tooltip being displayed is plain and lacks any design elements

When I hover over my a element, only a simple tooltip appears without any styling, unlike what is shown in the Bootstrap documentation. (I am creating the a element using JavaScript) HTML <!DOCTYPE html> <html lang="en"> <head> ...

Exploring the object tag box model and its properties for width and padding in Firefox version 6

Hey there, I've been puzzled by the fact that my Firefox browser seems to be using a different box model for my video embeds compared to Chrome. Even though the same CSS rules are being applied, if the object tag includes attributes like data="whateve ...

Allowing CSS to break long words but not spaces for better readability

Imagine you have the following paragraph: thisisaverylongwordthatneverbreaks Applying word-wrap:break-word; results in: thisisaverylongwordthat neverbreaks This works well, but what if I try: this is avery long word that has spaces The output becom ...

Using multiple instances of the Summernote Wysiwyg editor on a single page with identical placeholders

I have been using summernote successfully in my application, but I have encountered a minor issue where I have 2 editors on one page. The placeholder in the second editor seems to be inheriting the placeholder of the first editor. Is there a simple solut ...

Position a modal in the vertical center with scroll functionality for handling extensive content

Looking for ways to tweak a Modal's CSS and HTML? Check out the code snippets below: div.backdrop { background-color: rgba(0, 0, 0, 0.4); height: 100%; left: 0; overflow: auto; position: fixed; top: 0; width: 100%; z-index: 2020; } ...

The :focus pseudo-class is failing to target the input element

I'm dealing with a simple input field of type text: <input matInput type="text" placeholder="{{placeholder}}" class="input-field" [ngClass]="{'error': hasErrors}" [readonly]="isReadonly&quo ...

Having trouble with the Handlebars {{#if}} and {{elseif}} block helpers not functioning properly?

When working with handlebars.js, I am faced with the task of parsing complex JSON and displaying names in different styles based on certain conditions. The JSON structure is as follows: "TradeLine":{ "TradeLine":{ "Mor ...

recognizing a specific attribute of a website

Apologies for the unclear heading. I am on the lookout for a specific feature that has become a common sight on numerous websites lately. It's an animation used by freelancers when showcasing "projects worked on" or "hours spent coding". A counter s ...

Comparing the Calculation of CSS Selector Specificity: Class versus Elements [archived]

Closed. This question requires additional information for debugging purposes. It is not currently accepting answers. ...

Using PHP's header function to alter directories

So I am currently diving into PHP and facing a challenge with using headers. My setup involves using xampp for development purposes. I have a basic form where users can log in on "index.php". Upon successful login, the header function kicks in to redirect ...

After inputting new values, the table is not allowing me to update it

Recently acquainted with Angular, I am in the process of inserting new values and displaying them in a table using three components. These components include one for listing user information user-list, one for creating information rows user-form, and one f ...