0
0
Tailwindmarkup~20 mins

Square bracket notation for custom values in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Square Bracket Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
1:30remaining
Using square bracket notation for custom colors in Tailwind CSS
Which Tailwind CSS class correctly applies a background color of #1a2b3c using square bracket notation?
Abg-[#1a2b3c]
Bbg-#1a2b3c
Cbg-[[#1a2b3c]]
Dbg-1a2b3c
Attempts:
2 left
💡 Hint
Remember that Tailwind uses square brackets to wrap custom values without spaces.
rendering
intermediate
1:30remaining
Visual effect of square bracket notation for custom font size
What font size will the text have when using the class text-[22px] in Tailwind CSS?
Tailwind
<p class="text-[22px]">Sample Text</p>
AThe text will be 22 pixels tall.
BThe text size will not change and cause an error.
CThe text size will be 2.2 rem.
DThe text will be the default Tailwind font size.
Attempts:
2 left
💡 Hint
Square bracket notation sets exact CSS values.
selector
advanced
1:30remaining
Selecting elements with custom width using square bracket notation
Which Tailwind CSS class sets an element's width to exactly 18.5rem using square bracket notation?
Aw-[18,5rem]
Bwidth-[18.5rem]
Cw-18.5rem
Dw-[18.5rem]
Attempts:
2 left
💡 Hint
Tailwind uses w- prefix for width and square brackets for custom values.
layout
advanced
1:30remaining
Using square bracket notation for custom margin in Tailwind CSS
You want to add a left margin of exactly 13.75rem to a div. Which class correctly applies this margin using square bracket notation?
Tailwind
<div class="???">Content</div>
Aml-[13,75rem]
Bml-[13.75rem]
Cml-13.75rem
Dmargin-left-[13.75rem]
Attempts:
2 left
💡 Hint
Tailwind uses ml- for margin-left and square brackets for custom values.
accessibility
expert
2:00remaining
Accessibility considerations when using square bracket notation for custom colors
You apply a text color using text-[#123456] in Tailwind CSS. What is the best practice to ensure good accessibility?
Tailwind
<p class="text-[#123456]">Important text</p>
AUse any custom color since Tailwind guarantees accessibility.
BAdd <code>aria-label</code> to fix color contrast issues automatically.
CCheck the color contrast ratio against the background to ensure readability.
DAvoid using square bracket notation for colors to maintain accessibility.
Attempts:
2 left
💡 Hint
Accessibility depends on color contrast, not just syntax.