How do you turn a html element into a flex container?
Experience Level: Junior
Tags: CSSFlexbox
Answer
To turn a HTML element into a flex container, you need to set a CSS display property to flex;
CSS
.d-flex {
display: flex;
}
HTML
<div class="d-flex"></div>
Related Flexbox job interview questions
Using Flexbox, how can you align elements to right?
CSSFlexbox JuniorWhat does justify-content CSS property do and what values can it have?
CSSFlexbox JuniorWhat is a relation between flex container and flex item?
CSSFlexbox JuniorWhat is a flex item and what is its job?
CSSFlexbox JuniorWhat is a flex container and what is its job?
CSSFlexbox Junior