Answer the question
In order to leave comments, you need to log in
How to fix display: flex if it's not working properly?
I'm making a navigation menu, there was such a problem: display flex on the parent element does not distribute elements to the entire block. Here is the code:
HTML
LESS
.shop_slider {
.top_title_line {
min-height: 81px;
background: linear-gradient(#ff6c22, #ff4616);
display: flex;
align-items: center;
color: #fff;
.fredoka_font();
.shop_box_title {
flex-grow: 1;
text-align: center;
}
.left, .right {
display: block;
opacity: 50%;
}
}
}
.shop_slider .top_title_line {
min-height: 81px;
background: linear-gradient(#ff6c22, #ff4616);
display: flex;
align-items: center;
color: #fff;
font-family: 'Fredoka One', cursive;
}
.shop_slider .top_title_line .shop_box_title {
flex-grow: 1;
text-align: center;
}
.shop_slider .top_title_line .left,
.shop_slider .top_title_line .right {
display: block;
opacity: 50%;
}
Answer the question
In order to leave comments, you need to log in
Well, the flex in top_title_line only affects the single nested shop_slider_navigation tag - it does n't affect the tags inside shop_slider_navigation in any way.
And to distribute the blocks inside the shop_slider_navigation, you need display: flex; and set flex settings for shop_slider_navigation.
PS In the question editor there is an insert code button - with which you can insert both HTML and CSS normally. Making HTML an image doesn't make sense and only hinders the responders.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question