I am currently working on a Frequently Asked Questions section for a project I am developing. My goal is to compile a list of common questions that potential buyers may have. I envision a setup where, upon clicking the +
button next to the question, a new paragraph will expand below to provide the answer. One issue I am facing is ensuring that all the +
buttons are aligned vertically with each other. Currently, the position of each +
button varies based on the length of the question. Although I have implemented justify-content: space-between
to add some spacing between the question and the +
, it results in a messy look as the +
buttons are not uniformly aligned.
section {
background-color: #fff;
height: 100vh;
height: fill-available;
min-height: -moz-available;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow-x: hidden;
}
.faq {
display: flex;
flex-direction: column;
justify-content: center;
}
.container {
display: flex;
width: 60vw;
}
.left {
width: 100%;
}
.get-started {
font-family: "Poppins", sans-serif;
font-size: 28px;
}
.question {
display: flex;
justify-content: space-between;
}
<section class="faq">
<div class="container">
<div class="left">
<div class="get-started">
<p>Learn How To Get Started</p>
</div>
<div class="question">
<p>How do I create a website?</p>
<button>+</button>
<div>
<p></p>
</div>
</div>
<div class="question">
<p>Is this website right for me?</p>
<button>+</button>
<div>
<p></p>
</div>
</div>
<div class="question">
<p>How much will web storage cost me?</p>
<button>+</button>
<div>
<p></p>
</div>
</div>
</div>
</div>
</section>