Complete the code to center a div horizontally using Flexbox.
.container {
display: flex;
justify-content: [1];
}flex-start or flex-end which aligns items to edges.align-items with justify-content.Using justify-content: center; centers the child elements horizontally inside the flex container.
Complete the code to make a button change color when hovered.
button:hover {
background-color: [1];
}none or transparent which won't show a color change.inherit which keeps the original color.Setting background-color to a color like #3498db changes the button's background on hover.
Fix the error in the code to make the navigation bar sticky at the top.
nav {
position: [1];
top: 0;
width: 100%;
}relative or static which do not fix the element on scroll.absolute without proper context which may not stick the element.Using position: fixed; makes the navigation bar stay at the top when scrolling.
Fill both blanks to create a responsive grid with 3 columns and 1rem gap.
.grid-container {
display: [1];
grid-template-columns: repeat([2], 1fr);
gap: 1rem;
}flex instead of grid for grid layout.repeat().Using display: grid; and grid-template-columns: repeat(3, 1fr); creates a grid with 3 equal columns and 1rem gap.
Fill all three blanks to create a button with padding, border radius, and a shadow.
button {
padding: [1];
border-radius: [2];
box-shadow: 0 4px 6px [3];
}Padding 1rem 2rem adds vertical and horizontal space inside the button. Border radius 0.5rem rounds corners. Box shadow with rgba(0, 0, 0, 0.1) adds a subtle shadow.