У меня есть меню, и когда я пытаюсь изменить размер окна браузера, все становится беспорядочным - элементы меняют свое положение. Однако я хочу, чтобы они были на одной линии. Вот фрагмент:
.mainMenu {
width: 100%;
position: absolute;
top: 90px;
z-index: 100
}
.mainMenu .tripleDot {
float: left;
width: 90px;
font-family: Georgia, serif;
font-size: 40px;
font-style: italic;
font-weight: bold;
margin: 5px;
line-height: 40px;
text-align: center;
}
.mainMenu .tripleDot::after {
position: relative;
content: "";
display: inline-block;
width: 0.3em;
height: 0.3em;
border-right: 0.15em solid black;
border-top: 0.15em solid black;
transform: rotate(45deg);
top: 5.3px;
}
.mainMenu .step {
float: left;
min-width: 100px;
max-width: 200px;
width: 25%;
}
.mainMenu .step-text {
font-family: Georgia, serif;
font-size: 18px;
font-style: italic;
font-weight: bold;
text-align: center;
}
.mainMenu .step-number {
font-family: Georgia, serif;
font-size: 40px;
font-style: italic;
font-weight: bold;
border-radius: 50%;
width: 70px;
height: 70px;
line-height: 60px;
text-align: center;
margin: auto;
}<ul class = "mainMenu">
<li class = "step" id = "step1">
<a href = "#">
<div class = "step-number">A</div>
<div class = "step-text">Select</div>
</a>
</li>
<li class = "tripleDot xs-hidden">.....</li>
<li class = "step" id = "step2">
<a href = "#">
<div class = "step-number">B</div>
<div class = "step-text">Select</div>
</a>
</li>
<li class = "tripleDot xs-hidden">.....</li>
<li class = "step">
<a href = "#">
<div class = "step-number">C</div>
<div class = "step-text">Upload</div>
</a>
</li>
</ul>Класс xs-hidden происходит от gridlex и предназначен для скрытия div в мобильном представлении.
Я попытался поиграть с позиционированием, но без изменений. Любые советы, как это можно решить?






Вы можете применить display: flex к .mainMenu. Смотрите отрывок:
.mainMenu {
width: 100%;
position: absolute;
top: 90px;
z-index: 100;
display: flex
}
.mainMenu .tripleDot {
float: left;
width: 90px;
font-family: Georgia, serif;
font-size: 40px;
font-style: italic;
font-weight: bold;
margin: 5px;
line-height: 40px;
text-align: center;
}
.mainMenu .tripleDot::after {
position: relative;
content: "";
display: inline-block;
width: 0.3em;
height: 0.3em;
border-right: 0.15em solid black;
border-top: 0.15em solid black;
transform: rotate(45deg);
top: 5.3px;
}
.mainMenu .step {
float: left;
min-width: 100px;
max-width: 200px;
width: 25%;
}
.mainMenu .step-text {
font-family: Georgia, serif;
font-size: 18px;
font-style: italic;
font-weight: bold;
text-align: center;
}
.mainMenu .step-number {
font-family: Georgia, serif;
font-size: 40px;
font-style: italic;
font-weight: bold;
border-radius: 50%;
width: 70px;
height: 70px;
line-height: 60px;
text-align: center;
margin: auto;
}<ul class = "mainMenu">
<li class = "step" id = "step1">
<a href = "#">
<div class = "step-number">A</div>
<div class = "step-text">Select</div>
</a>
</li>
<li class = "tripleDot xs-hidden">.....</li>
<li class = "step" id = "step2">
<a href = "#">
<div class = "step-number">B</div>
<div class = "step-text">Select</div>
</a>
</li>
<li class = "tripleDot xs-hidden">.....</li>
<li class = "step">
<a href = "#">
<div class = "step-number">C</div>
<div class = "step-text">Upload</div>
</a>
</li>
</ul>