Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

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>

Comments

No Comments Yet.
Be the first to tell us what you think.
Flexbox
Flexbox

Are you learning Flexbox ? Try our test we designed to help you progress faster.

Test yourself
25 Flexbox questions that will help you to nail your job interview
25 Flexbox questions that will help you to nail your job interview

Are you learning Flexbox ? Try our test we designed to help you progress faster.

Test yourself