У меня небольшой опрос по трем столбцам макета.
На рабочем столе это выглядит так:
Моя проблема на экране мобильного телефона.У меня один человек под другим и после этого вопросы.См. Изображение ниже.
Чего я хочу добиться, это Лица 1 и затем вопросы, Лица 2, а затем вопросы, Лица 3 и затем вопросы, что-то вроде этого:
Кто-нибудь знает, как решить эту проблему?
Вот HTMl:
<div class="col-md-12 col-xs-12">
<div class="d-table">
<div class="d-table-row">
<div class="d-table-cell align-middle"></div>
<div class="d-table-cell align-middle">
<div class="titleMiddle">Person 1</div>
</div>
<div class="d-table-cell align-middle">
<div class="titleMiddle">Person 2</div>
</div>
<div class="d-table-cell align-middle">
<div class="titleMiddle">Person 3</div>
</div>
</div>
<div class="d-table-row">
<div class="d-table-cell align-middle pb-4">
<div class="question">
<div class="smalltitle">
<span class="prefiks">1</span>
<span>This is a very nice question</span>
</div>
</div>
</div>
<div class="d-table-cell align-middle pb-4">
<div class="horizontal">
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="1">
</div>
<div class="answerText">1</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="2">
</div>
<div class="answerText">2</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="3">
</div>
<div class="answerText">3</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="4">
</div>
<div class="answerText">4</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="5">
</div>
<div class="answerText">5</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="6">
</div>
<div class="answerText">No answer</div>
</div>
</div>
</div>
<div class="d-table-cell align-middle pb-4">
<div class="horizontal">
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="1">
</div>
<div class="answerText">1</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="2">
</div>
<div class="answerText">2</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="3">
</div>
<div class="answerText">3</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="4">
</div>
<div class="answerText">4</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="5">
</div>
<div class="answerText">5</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="6">
</div>
<div class="answerText">No Answer</div>
</div>
</div>
</div>
<div class="d-table-cell align-middle pb-4">
<div class="horizontal">
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="1">
</div>
<div class="answerText">1</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="2">
</div>
<div class="answerText">2</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="3">
</div>
<div class="answerText">3</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="4">
</div>
<div class="answerText">4</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="5">
</div>
<div class="answerText">5</div>
</div>
<div class="answer answerRight">
<div class="answerInput">
<input type="radio" name="name" value="6">
</div>
<div class="answerText">No answer</div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.d-table {
display: table!important;
}
.d-table-row {
display: table-row !important;
}
* {
-webkit-font-smoothing: antialiased;
}
*, ::after, ::before {
box-sizing: inherit;
}
.d-table-cell {
display: table-cell!important;
}
.align-middle {
vertical-align: middle!important;
}
.align-middle > div {
margin-right: 50px;
}
.titleMiddle {
font-weight: 700;
margin-bottom: 30px;
}
.pb-4, .py-4 {
padding-bottom: 1.5rem!important;
}
.smalltitle {
margin-bottom: 20px;
}
.horizontal {
display: flex !important;
flex-direction: row !important;
}
.answer {
margin-left: 15px;
margin-bottom: 5px;
padding: 6px;
}
.answerRight {
display: flex !important;
flex-direction: row !important;
align-items: center;
}
input[type='radio'] {
width: 13px;
height: 13px;
background: white;
border-radius: 50%!important;
border: 1px solid #343c49;
-moz-appearance: none;
-webkit-appearance: none;
}
input[type='radio']:checked {
background: #06c;
}
.answerText {
margin-left: 0.375rem;
}