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粉4623289042024-01-30 00:40:50
Remove width: 100%;
from the .container .title
selector.
.container .title { display: flex; /* width: 100%; */ }