#1a2b3c using square bracket notation?The correct syntax for custom colors in Tailwind uses square brackets around the value with no extra characters. Option A is correct: bg-[#1a2b3c]. Option A and D omit brackets, which is invalid. Option A adds an extra bracket inside, causing a syntax error.
text-[22px] in Tailwind CSS?<p class="text-[22px]">Sample Text</p>The class text-[22px] sets the font size exactly to 22 pixels. Tailwind allows custom values inside square brackets to override defaults. So the text will appear 22 pixels tall.
w- prefix for width and square brackets for custom values.Option D is correct because w-[18.5rem] sets width to 18.5 rem exactly. Option D uses an invalid prefix. Option D lacks brackets and is invalid. Option D uses a comma instead of a dot, which is invalid in CSS.
<div class="???">Content</div>ml- for margin-left and square brackets for custom values.Option B is correct: ml-[13.75rem] sets margin-left to 13.75 rem exactly. Option B uses an invalid prefix. Option B lacks brackets, so it is invalid. Option B uses a comma instead of a dot, which is invalid in CSS.
text-[#123456] in Tailwind CSS. What is the best practice to ensure good accessibility?<p class="text-[#123456]">Important text</p>Using custom colors requires checking contrast to ensure text is readable for all users. Tailwind does not automatically guarantee accessibility for custom colors. Adding aria-label does not fix color contrast. Avoiding square bracket notation is unnecessary if contrast is good.