CSS Grid is designed for two-dimensional layouts controlling both rows and columns. Flexbox is mainly for one-dimensional layouts, either row or column.
Flexbox container uses display: flex;. The properties justify-content and align-items center items horizontally and vertically. justify-items is not valid for flex containers.
.container { display: grid; grid-template-areas: "header header header" "sidebar content content" "footer footer footer"; grid-template-columns: 1fr 2fr 1fr; grid-template-rows: auto 1fr auto; }
The grid-template-areas define a 3-row layout. The first row has 'header' spanning all 3 columns. The second row has 'sidebar' in first column and 'content' spanning next two columns. The last row has 'footer' spanning all columns.
:nth-child(2) selects the second child element regardless of type. Using the child combinator > ensures only direct children are selected. Option B correctly selects the second direct child of .container.
Using semantic HTML elements like <section>, <article>, and ensuring the tab order follows the visual layout helps keyboard users navigate intuitively. Avoid disabling keyboard navigation or misusing tabindex.