When I apply flex to the display of .ant-steps-item-icon, the connection between the steps vanishes

I recently utilized ANTD and React to develop a customized component step style, but ran into an issue. Here is the CSS code snippet I used:

/* step connector */
.ant-steps-item-title:after {
    border: solid rgba(65, 64, 66, 0.1) !important;
}

/* step */
.ant-steps-item-icon{
    width: 3em;
    height: 3em;
    display: flex; // ==> when i add this
    justify-content: center; // ==> when i add this
    align-items: center; // ==> when i add this
}


.ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-icon {
    background-color: #21D47E;
    border-color: #21D47E;

}

/* size of step container */
.ant-steps{
    width: 50%;

} 

.ant-steps-horizontal .ant-steps-label-horizontal{
    display: flex;
    justify-content: center;
    align-items: center;
}

After attempting to center the numbers using the following CSS:

.ant-steps-item-icon{
    width: 3em;
    height: 3em;
    display: flex; *
    justify-content: center; *
    align-items: center; *
}

The steps connector vanished as shown here: https://i.sstatic.net/y0egD.png

This excerpt showcases how my react component calls Steps:

import { Steps } from 'antd'
import React from 'react'
import './index.css'

const { Step } = Steps

export const Tahap: React.FC = () => {
  return (
    <div style={{ padding: '50px' }}>
      <Steps>
        <Step />
        <Step />
        <Step />
        <Step />
        <Step />
        <Step />
      </Steps>
    </div>
  )
}

If anyone has insights on how to re-display the connector, I would greatly appreciate it. Thank you.

Answer №1

In order to achieve the intended outcome, it is crucial to utilize the CSS display property with the value of inline-flex instead of flex:

.custom-icon-item {
  width: 3em;
  height: 3em;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

This adjustment will ensure that the flex container is displayed inline.

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

Unable to transfer an array from getStaticProps method in Next.js

Whenever I pass a JSON array from getStaticProps in Next.js, I encounter this specific error message when trying to access it. TypeError: Cannot read property 'contentBody' of undefined module.exports../pages/[author]/[article].js.__webpack_expo ...

Issue with Props Type Check not functioning as expected in Typescript with React

I am utilizing Typescript within my React application. I aim to rigorously verify the type of props being passed to my components and trigger an error if it does not match. import React from "react"; import styles from "./ServiceDetailCard.css"; type Ser ...

The webpage is completely blank, displaying only a stark white screen

After designing a website, I encountered an issue where upon opening it in the browser, it only shows a blank white page. I am puzzled as to why this is happening. Could you please take a look at this link and assist me? Thank you in advance. ...

Understanding the significance behind `() => {}` syntax in ReactJS

While following along with a React tutorial, I stumbled upon the following code snippet: setTimeout(() => { this.setState({name: "Bob"}); }, 1000) As someone who is still getting acquainted with JavaScript, I must admit that I am unsure about ...

BOOTSTRAP: changing the layout of panels in various sizes for mobile devices

I'm struggling with how to reorganize my panels on mobile devices. Each panel has a different size. Please refer to the attached screenshot for the page layout on large screens (col-lg): https://i.sstatic.net/xcqaT.png EDIT: The layout on large scre ...

The issue arises when the desired image size is not reflected correctly on the background after changing

I've been working on a basic image slideshow where the background image changes based on user selection. However, I've noticed that when I change the image for the first time, the backgroundSize: cover property seems to disappear. Even if I try c ...

The hover effect is not activated by the mouse movement event

I previously encountered an issue related to flickering with an absolute div when moving my mouse, which I managed to resolve by increasing the distance between my mouse pointer and the div. Now, I am working on the next phase of my project: My goal is t ...

SliderToggle and Div implementation in Internet Explorer (IE) using jQuery

I'm encountering an issue with jQuery's slideToggle function and a div specifically in IE. Here is the code snippet causing the problem: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.d ...

What could be causing my items to appear twice and as blank elements?

I'm feeling a bit lost here as to why my code isn't functioning correctly. For some reason, it's not displaying the predefined items that I've set up. Any guidance or assistance would be greatly appreciated. Dealing with Angular errors ...

Issue: Trouble with Rotating Tooltips in Javascript

I am facing a challenge with the tooltips on my website. I want to ensure that all tooltips have a consistent look and transition effects, but I am struggling to achieve this. The rotation and other effects applied using javascript are not functioning prop ...

How come I am unable to retrieve a field within a method of the same class?

Here is a snippet of the code from my component: export class RootComponent { isActive = true; setVal(j) { if (j == 0) { isActive = false; } } } I am new to Angular and I have a question that might seem basic. Why am I unable to acce ...

Leveraging Next.js ISR to pass extra information to the getStaticProps function from the getStaticPaths

Inside SingleBlogPost.jsx, the code for generating blog pages by their slug is as follows: export async function getStaticPaths() { const res = await fetch("http://localhost:1337/api/posts"); let { data } = await res.json(); const paths = data.map(( ...

What steps should I take to address the issue of ERESOLVE being unable to resolve the dependency tree during an

As I delve into the world of Angular and self-teaching, I encountered an issue after importing numerous new components into my project. Upon deleting the node_modules folder and running npm install, I am faced with the following error: npm ERR! ERESOLVE un ...

Ensure Website Accessibility by Implementing Minimum Resolution Requirements

Is it possible to create a website that only opens on screens with a resolution of at least 1024 x 768, and displays an error message on unsupported resolutions? I've tried using JavaScript to achieve this, but haven't had any success. Any assis ...

Preserve progress even after reloading the page

I am facing an issue with my React login/logout authentication implemented using Node and a database. After successfully logging in, when I refresh the page, the cookie retains the login state but the navbar menu still shows me as logged in instead of show ...

Wave your way to unique text creation with Firefox

Hey there, I've got some text inside a div that's been transformed with rotate(3deg). Strangely enough, in Firefox, the text appears wavy. When I remove the transform property from the div, the waviness disappears. Is there any way for me to keep ...

Enhancing the user experience of a current Play Framework web application through SPA functionality

Our web application, developed using Play Framework (1.*), is intricate and we are considering transitioning towards a SPA approach. Which JavaScript framework do you suggest for this transition? The majority of the business logic resides on the server sid ...

Is it possible in React to import only specific features from an npm module during installation using webpack or another tool?

I recently experimented with setting up webpack using the guidelines provided at: https://webpack.js.org/guides/getting-started/ Within this resource, I incorporated a function from the lodash npm module _.join(['Hello', 'webpack&apos ...

GWT 2.5.1 - How to Restrict the Amount of Items Displayed in a Dropdown Menu (ValueListBox)

Currently, I am utilizing a ValueListBox to showcase a range of values for users to choose from. The main issue I am encountering pertains to IE11 and its subpar behavior when interacting with the control: The dropdown list appears all over the place (in ...

How can we dynamically navigate to the next line within the Material UI DataGrid component when space is limited?

Currently, I am working with the datagrid component from material ui. I have retrieved some data from a database and am attempting to pass it to the datagrid component. However, I have noticed that certain fields contain long strings which do not fully app ...