0
0
Tailwindmarkup~10 mins

Flex basis and sizing in Tailwind - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the flex basis of the div to 1/3 of the container width using Tailwind CSS.

Tailwind
<div class="flex">
  <div class="[1]">Content</div>
</div>
Drag options to blanks, or click blank then click option'
Aflex-1
Bgrow
Cbasis-1/3
Dw-1/3
Attempts:
3 left
💡 Hint
Common Mistakes
Using flex-1 which sets flex-grow, not flex-basis.
Using w-1/3 which sets width, not flex basis.
2fill in blank
medium

Complete the code to make the flex item grow to fill available space.

Tailwind
<div class="flex">
  <div class="[1]">Flexible content</div>
</div>
Drag options to blanks, or click blank then click option'
Agrow
Bbasis-0
Cshrink
Dbasis-auto
Attempts:
3 left
💡 Hint
Common Mistakes
Using shrink which controls shrinking, not growing.
Using basis-0 which sets basis but does not enable growth.
3fill in blank
hard

Fix the error in the code to correctly set the flex basis to 50%.

Tailwind
<div class="flex">
  <div class="[1]">Half width</div>
</div>
Drag options to blanks, or click blank then click option'
Abasis-full
Bbasis-50
Cbasis-1/4
Dbasis-1/2
Attempts:
3 left
💡 Hint
Common Mistakes
Using basis-50 which is invalid.
Using basis-full which means 100%.
4fill in blank
hard

Fill both blanks to create a flex container with two items: one fixed at 1/4 width and the other growing to fill the rest.

Tailwind
<div class="flex">
  <div class="[1]">Fixed width</div>
  <div class="[2]">Flexible width</div>
</div>
Drag options to blanks, or click blank then click option'
Abasis-1/4
Bgrow
Cshrink
Dbasis-auto
Attempts:
3 left
💡 Hint
Common Mistakes
Using shrink instead of grow for flexible item.
Using basis-auto which does not fix width.
5fill in blank
hard

Fill all three blanks to create a flex container with three items: first fixed at 1/5 width, second grows, third shrinks if needed.

Tailwind
<div class="flex">
  <div class="[1]">Fixed 1/5</div>
  <div class="[2]">Grow</div>
  <div class="[3]">Shrink</div>
</div>
Drag options to blanks, or click blank then click option'
Abasis-1/5
Bgrow
Cshrink
Dbasis-auto
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up grow and shrink classes.
Using invalid basis fractions.