Challenge: Build a Layout with Flexbox
Task
Let's create a blog card. We need to change the default positioning behavior with the help of flex.
The task is to:
- Identify the parent element containing both the post image (
imgtag with thepost-imageclass name) and post information (divtag with thepost-infoclass name). - Apply flex properties to the parent element (
divtag with theblog-cardclass name). - Horizontally center the items within the card.
- Ensure that items cover the entire height of the card.
index.html
index.css
display: flex;can only be applied to the parent element.- The default flex direction is row, so we need to change it using the
flex-direction: column;property. - To center items horizontally, use
align-items: center;. - To space items vertically, use
justify-content: space-between;.
index.html
index.css
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 33
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 2.56
Challenge: Build a Layout with Flexbox
Deslize para mostrar o menu
Task
Let's create a blog card. We need to change the default positioning behavior with the help of flex.
The task is to:
- Identify the parent element containing both the post image (
imgtag with thepost-imageclass name) and post information (divtag with thepost-infoclass name). - Apply flex properties to the parent element (
divtag with theblog-cardclass name). - Horizontally center the items within the card.
- Ensure that items cover the entire height of the card.
index.html
index.css
display: flex;can only be applied to the parent element.- The default flex direction is row, so we need to change it using the
flex-direction: column;property. - To center items horizontally, use
align-items: center;. - To space items vertically, use
justify-content: space-between;.
index.html
index.css
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 33