Given this HTML snippet with Tailwind classes, what will you see in the browser?
<div class="w-24 h-24 bg-blue-500 transform scale-150"></div>
<div class="w-24 h-24 bg-blue-500 transform scale-150"></div>Look at the scale-150 class and remember it changes size.
The scale-150 class in Tailwind scales the element to 1.5 times its original size. The original size is 6rem by 6rem (24 * 0.25rem). So the blue square becomes 9rem by 9rem visually.
Choose the Tailwind class that rotates an element 45 degrees clockwise.
Tailwind uses rotate- followed by the degree number without spaces.
The class rotate-45 rotates the element 45 degrees clockwise. Negative rotation uses a minus sign before the class, like -rotate-45. rotate--45 is invalid. rotate45 is not a valid Tailwind class.
translate-x-4 and scale-50 on the same element?Consider an element with these Tailwind classes: transform translate-x-4 scale-50. What is the combined effect?
Remember Tailwind spacing units are multiples of 0.25rem. Also, scale-50 means 50% size.
translate-x-4 moves the element 1rem (4 * 0.25rem) to the right. scale-50 scales the element to 50% of its original size. Both transforms apply together.
Choose the correct Tailwind class that rotates an element 90 degrees counterclockwise.
Negative rotation classes start with a minus sign before the class name.
-rotate-90 rotates the element 90 degrees counterclockwise. rotate-90 is clockwise. rotate--90 is invalid syntax. rotate-270 rotates 270 degrees clockwise, which is equivalent but not the standard negative 90.
You have a button with transform scale-110 translate-y-1 on focus. What is the best way to keep the focus ring accessible and visible for keyboard users?
Focus rings help keyboard users see where they are. Tailwind has special classes for focus-visible.
Using focus-visible:ring-4 focus-visible:ring-blue-500 adds a visible ring only when keyboard focus is active, ensuring accessibility. Removing outlines or hiding the button breaks accessibility. pointer-events-none disables interaction, which is not good.