Tailwind CSS Interview Questions Hindi mein

Tailwind CSS कोर्स के 25 सवाल, हर सवाल के सही जवाब और explanation के साथ। जवाब देखने से पहले ख़ुद सोचें।

Utility-First Fundamentals

1. What is a core idea of utility-first CSS?

  1. Avoiding HTML classes entirely
  2. Writing one large class per page
  3. Composing small single-purpose classes directly in markup
  4. Using only inline style attributes
जवाब देखें

जवाब: Composing small single-purpose classes directly in markup

Utilities are composed in markup.

पाठ: What Utility-First Means

2. How do you include Tailwind in a v4 stylesheet?

  1. @import "tailwindcss";
  2. @tailwind everything;
  3. <script src="tailwind.css">
  4. require("tailwind")
जवाब देखें

जवाब: @import "tailwindcss";

v4 uses a single CSS import.

पाठ: Setting Up Tailwind CSS v4

3. Why does `bg-${color}-500` fail to produce styles?

  1. It needs !important
  2. Template literals are not allowed in HTML
  3. Red is not a Tailwind colour
  4. Tailwind detects complete class names as text, and that string never appears whole
जवाब देखें

जवाब: Tailwind detects complete class names as text, and that string never appears whole

Use full class names.

पाठ: How Classes Become CSS

Spacing, Typography and Colour

4. With the default spacing of 0.25rem, how much padding does p-4 give?

  1. 4px
  2. 1rem
  3. 4rem
  4. 0.4rem
जवाब देखें

जवाब: 1rem

4 × 0.25rem.

पाठ: Spacing and Sizing

5. Which utility limits text to three lines with an ellipsis?

  1. truncate-3
  2. line-clamp-3
  3. text-3
  4. leading-3
जवाब देखें

जवाब: line-clamp-3

truncate is for a single line.

पाठ: Typography

6. What does bg-black/50 produce?

  1. A 50% grey
  2. A black background 50px wide
  3. Black text at 50% size
  4. A black background at 50% opacity
जवाब देखें

जवाब: A black background at 50% opacity

Slash adds opacity.

पाठ: Colour and Opacity

Layout With Flexbox and Grid

7. Which utility vertically centres items in a horizontal flex row?

  1. items-center
  2. justify-center
  3. text-center
  4. content-center-x
जवाब देखें

जवाब: items-center

Cross-axis alignment.

पाठ: Flexbox

8. How do you make an item span two grid columns?

  1. span-x-2
  2. grid-2
  3. col-span-2
  4. w-2
जवाब देखें

जवाब: col-span-2

Column span utilities.

पाठ: CSS Grid

9. What must the parent usually have for an absolute child to position relative to it?

  1. overflow-auto
  2. flex
  3. relative (or another non-static position)
  4. z-0 only
जवाब देखें

जवाब: relative (or another non-static position)

Absolute positions against the nearest positioned ancestor.

पाठ: Positioning and Layering

Responsive Design, States and Dark Mode

10. When does md:flex-row apply?

  1. At the md breakpoint and wider
  2. Only on medium screens
  3. Only below md
  4. Only on mobile
जवाब देखें

जवाब: At the md breakpoint and wider

Mobile-first: prefixes apply upwards.

पाठ: Mobile-First Breakpoints

11. How do you change a child's colour when its parent card is hovered?

  1. Use dark: on the parent
  2. Add hover: to the child only
  3. Use peer on the child
  4. Add group to the parent and group-hover: to the child
जवाब देखें

जवाब: Add group to the parent and group-hover: to the child

group links parent state to children.

पाठ: Hover, Focus, Group and Peer

12. By default, when do dark: utilities apply in Tailwind v4?

  1. Always
  2. When the system prefers a dark colour scheme
  3. Only after 6pm
  4. Only when a .dark class exists
जवाब देखें

जवाब: When the system prefers a dark colour scheme

Override with @custom-variant for a toggle.

पाठ: Dark Mode

Customising Tailwind

13. What does declaring --color-brand-500 inside @theme enable?

  1. Nothing until a config file is added
  2. Utilities such as bg-brand-500 and text-brand-500
  3. Only a CSS variable without utilities
  4. A new breakpoint
जवाब देखें

जवाब: Utilities such as bg-brand-500 and text-brand-500

Theme variables create utilities.

पाठ: Design Tokens With @theme

14. How do you write a space inside an arbitrary value?

  1. With a comma only
  2. With %20
  3. Spaces are allowed directly
  4. With an underscore, as in grid-cols-[1fr_2fr]
जवाब देखें

जवाब: With an underscore, as in grid-cols-[1fr_2fr]

Class names cannot contain spaces.

पाठ: Arbitrary Values and Properties

15. What is a good use of @apply?

  1. Styling third-party or CMS markup you cannot add classes to
  2. Recreating a class for every component
  3. Replacing all utilities in HTML
  4. Defining breakpoints
जवाब देखें

जवाब: Styling third-party or CMS markup you cannot add classes to

Use it sparingly.

पाठ: Custom Utilities, Variants and @apply

Building Components

16. Which classes give a disabled button visual feedback?

  1. focus:hidden
  2. hover:opacity-50
  3. disabled:opacity-50 disabled:cursor-not-allowed
  4. opacity-0
जवाब देखें

जवाब: disabled:opacity-50 disabled:cursor-not-allowed

The disabled: variant targets :disabled.

पाठ: Buttons and Variants

17. Which variant styles an input whose aria-invalid attribute is true?

  1. dark:
  2. hover:
  3. aria-invalid:
  4. group-invalid-only:
जवाब देखें

जवाब: aria-invalid:

ARIA attribute variants.

पाठ: Forms

18. What is the recommended way to reuse a styled button across a React app?

  1. Create a Button component that holds the classes
  2. Copy the class list everywhere
  3. Build class names from string fragments
  4. Use inline style objects only
जवाब देखें

जवाब: Create a Button component that holds the classes

Reuse markup through components.

पाठ: Extracting Reusable Components

Modern CSS Features and Accessibility

19. What must you add before @md: variants work?

  1. A JavaScript resize listener
  2. A media query in CSS
  3. The md: variant on the same element
  4. The @container class on an ancestor
जवाब देखें

जवाब: The @container class on an ancestor

Mark the container first.

पाठ: Container Queries

20. Which variant disables motion for users who prefer reduced motion?

  1. hover:
  2. motion-reduce:
  3. print:
  4. dark:
जवाब देखें

जवाब: motion-reduce:

Respect prefers-reduced-motion.

पाठ: Transitions and Animation

21. What does sr-only do?

  1. Removes content from the DOM
  2. Hides content visually but keeps it readable by screen readers
  3. Shows content only on small screens
  4. Makes text red
जवाब देखें

जवाब: Hides content visually but keeps it readable by screen readers

For accessible labels.

पाठ: Accessibility Utilities

Tailwind in Production

22. What does prettier-plugin-tailwindcss do?

  1. Adds dark mode automatically
  2. Compiles Tailwind to JavaScript
  3. Removes unused HTML
  4. Sorts Tailwind classes in a consistent order
जवाब देखें

जवाब: Sorts Tailwind classes in a consistent order

Consistent ordering reduces noise.

पाठ: Editor and Formatting Tooling

23. What decides which of two conflicting utilities wins without tooling?

  1. Their order in the generated CSS
  2. Their order in the class attribute
  3. Alphabetical order
  4. The longer class name
जवाब देखें

जवाब: Their order in the generated CSS

Use tailwind-merge for predictable overrides.

पाठ: Conditional Classes and Conflicts

24. Where do design tokens usually live in Tailwind v4?

  1. In package.json
  2. Only in tailwind.config.js
  3. In an @theme block in CSS
  4. In HTML meta tags
जवाब देखें

जवाब: In an @theme block in CSS

CSS-first configuration.

पाठ: Migrating From v3 to v4

25. Which item belongs on a Tailwind review checklist?

  1. Remove all focus outlines
  2. Use dynamic class name fragments
  3. Every interactive element has a visible focus style
  4. Repeat arbitrary hex colours everywhere
जवाब देखें

जवाब: Every interactive element has a visible focus style

Accessibility and maintainability.

पाठ: A Tailwind Project Checklist

← कोर्स पर वापस जाएँ