How can I make "question" vertically center-aligned with "answer-text", but not with "submit-answer-button"?
.question-container {
display: flex;
flex-direction: column;
align-items: center;
}
.answer-container {
display: flex;
justify-content: center;
}
<div class="question-container">
<div id="question">6 x 2</div>
<div class="answer-container">
<input type="text" id="answer-text">
<button id="submit-answer-button" onclick="submitAnswer()">Submit</button>
</div>
</div>
2
Answers
Is that what you’re looking for?
Basically what I did here is put everything in row-directed flexbox, and added two children each represent a column.
Finaly, I set alignment to the left column, so it is centered.
Just put the question
div
and the answerinput
in the samediv
and give it the same style as the main containercontainer-1
: