Complete the code to add horizontal space between flex items using Tailwind CSS.
<div class="flex [1]"> <div class="bg-blue-500 text-white p-4">Item 1</div> <div class="bg-green-500 text-white p-4">Item 2</div> <div class="bg-red-500 text-white p-4">Item 3</div> </div>
gap-4 which adds gap but works differently in flex context.The space-x-4 class adds horizontal spacing between flex children.
Complete the code to add vertical space between flex items arranged in a column.
<div class="flex flex-col [1]"> <div class="bg-purple-500 text-white p-3">First</div> <div class="bg-yellow-500 text-black p-3">Second</div> <div class="bg-pink-500 text-white p-3">Third</div> </div>
space-x-6 which adds horizontal space, not vertical.The space-y-6 class adds vertical spacing between flex children arranged in a column.
Fix the error in the code to correctly add gap between flex children.
<div class="flex [1]"> <div class="bg-gray-700 text-white p-2">Box A</div> <div class="bg-gray-500 text-white p-2">Box B</div> </div>
space-4 which is not a valid Tailwind class.gap4.The correct Tailwind class to add gap between flex children is gap-4.
Fill both blanks to add horizontal space between flex children and center them vertically.
<div class="flex [1] [2]"> <div class="bg-indigo-600 text-white p-3">Alpha</div> <div class="bg-indigo-400 text-white p-3">Beta</div> </div>
justify-center which centers items horizontally, not vertically.gap-x-8 which is not the space-x utility.space-x-8 adds horizontal space between flex children. items-center centers them vertically.
Fill all three blanks to create a vertical flex container with vertical spacing and horizontally centered items.
<div class="flex flex-col [1] [2] [3]"> <div class="bg-teal-600 text-white p-4">One</div> <div class="bg-teal-400 text-white p-4">Two</div> <div class="bg-teal-200 text-black p-4">Three</div> </div>
gap-5 which adds gap but does not control alignment.justify-center which centers items vertically instead of top aligning.space-y-5 adds vertical spacing between items. items-center centers items horizontally. justify-start aligns items at the top vertically.