Complete the code to set a container to use Flexbox layout.
<div style="display: [1];"> <p>Item 1</p> <p>Item 2</p> </div>
display: block; which is default and not Flexbox.display: grid; which is for grid layout, not Flexbox.Setting display: flex; makes the container use Flexbox layout, arranging child items in a flexible row or column.
Complete the code to create a grid container with two columns.
<div style="display: grid; grid-template-columns: [1];"> <div>Box 1</div> <div>Box 2</div> </div>
grid-template-columns: 1fr 1fr; creates two equal columns in the grid container.
Fix the error in the Flexbox container to center items horizontally.
<div style="display: flex; justify-content: [1];"> <div>Centered Item</div> </div>
start which aligns items to the left.space-between which spreads items apart.Using justify-content: center; centers the flex items horizontally inside the container.
Fill both blanks to create a grid with three equal columns and a gap between them.
<div style="display: grid; grid-template-columns: [1]; gap: [2];"> <div>Box A</div> <div>Box B</div> <div>Box C</div> </div>
grid-template-columns: repeat(3, 1fr); creates three equal columns.gap: 20px; adds space between grid items.
Fill all three blanks to create a Flexbox container that stacks items vertically and centers them vertically.
<div style="display: [1]; flex-direction: [2]; justify-content: [3];"> <div>Item 1</div> <div>Item 2</div> <div>Item 3</div> </div>
display: grid; instead of flex.flex-direction: row; which stacks horizontally.Setting display: flex; activates Flexbox.flex-direction: column; stacks items vertically.justify-content: center; centers items vertically along the main axis.