Home  >  Q&A  >  body text

I'm confused why I can't justify-content: space- Between or space-evenly on this issue?

I'm trying to evenly space this layout, it's basically like a card layout. I'm confused why it has no spacing despite doing justify-content: space- Between or space-evenly. I want the "other" to be evenly spaced.

This is my JSX

<section className="skills-wrapper">
    <div className="content-wrapper">
        <h1>Tech-Stack</h1>
        <div className="container">
            <div className="title">
                <h2>Web Development</h2>
                <div className="box">
                    <div className="name">
                    </div>
                </div>
            </div>
            <div className="title">
                <h2>Software Development</h2>
                <div className="box">
                    <div className="name">
                     </div>
                </div>
            </div>
            <div className="title">
                <h2>Others</h2>
                <div className="box">
                    <div className="name">
                     </div>
                </div>
            </div>
        </div>
    </div>
</section>

This is my CSS:

.skills-wrapper{
  width: 100%;
  height: 100vh;
  background: #CCD6F6;
}

.content-wrapper{
  width: 100%;
  max-width: 75.5em;
  padding: 1.875em;
  margin: 0 auto;
}

.content-wrapper h1{
  font-size: 2rem;
  color: #E1065E;
  padding: 0.524em 0;
}

.container{
  background: #999;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container .title{
  display: flex;
  width: 100%;
}

I tried backtracking and executing again but I still can't figure it out. Can anyone help me? I'm lost

P粉320361201P粉320361201286 days ago340

reply all(1)I'll reply

  • P粉462328904

    P粉4623289042024-01-30 00:40:50

    Remove width: 100%; from the .container .title selector.

    .container .title {
        display: flex;
        /* width: 100%; */
    }

    reply
    0
  • Cancelreply