Arbitrary properties let you write any CSS style directly inside Tailwind classes using square brackets, even if Tailwind doesn't support that style by default.
Click to reveal answer
beginner
How do you write an arbitrary property for backdrop-filter: blur(5px); in Tailwind?
Use <code>[backdrop-filter:blur(5px)]</code> as a class to apply <code>backdrop-filter: blur(5px);</code>.
Click to reveal answer
intermediate
Why use arbitrary properties instead of custom CSS files?
They keep all styles in one place, make quick changes easy, and keep your code consistent with Tailwind's utility-first approach.
Click to reveal answer
intermediate
What syntax must you use to include spaces or special characters inside arbitrary properties in Tailwind?
You put the entire CSS value inside square brackets, and if it has spaces or special characters, you keep them as is, for example: bg-[url('image.png')].
Click to reveal answer
intermediate
Can you use arbitrary properties with responsive prefixes in Tailwind?
Yes! For example, md:[--my-var:10px] applies the custom property only on medium screens and up.
Click to reveal answer
How do you write an arbitrary CSS property for border-radius: 12px; in Tailwind?
Abr-[12px]
Bborder-radius-[12px]
Crounded-[12px]
Dradius-[12px]
✗ Incorrect
The correct Tailwind syntax for arbitrary border-radius is rounded-[12px].
Which of these is a valid arbitrary property class in Tailwind?
Atext-[color=blue]
Btext-[color:blue]
Ctext-[blue]
Dtext-[color blue]
✗ Incorrect
text-[color:blue] is valid and applies color: blue;.
Can you use arbitrary properties for CSS variables in Tailwind?
AYes, for example <code>[--my-var:10px]</code>.
BNo, Tailwind does not support CSS variables.
COnly with plugins.
DOnly in custom CSS files.
✗ Incorrect
Tailwind supports arbitrary properties including CSS variables like [--my-var:10px].
What happens if you write an invalid arbitrary property in Tailwind?
ATailwind ignores it and no style is applied.
BIt breaks the whole CSS build.
CIt applies a default style.
DIt throws a browser error.
✗ Incorrect
Invalid arbitrary properties are ignored and do not apply any style.
How do you apply an arbitrary property only on large screens in Tailwind?
Aproperty:lg-[value]
B[lg:property:value]
Cproperty:[lg:value]
Dlg:[property:value]
✗ Incorrect
Use the responsive prefix before the arbitrary property, like lg:[property:value].
Explain how arbitrary properties work in Tailwind CSS and why they are useful.
Think about how you can add CSS that Tailwind doesn't have built-in.
You got /3 concepts.
Describe how to write an arbitrary property with spaces or special characters in Tailwind CSS.
Remember the syntax uses brackets to hold the entire CSS value.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of using arbitrary properties in Tailwind CSS?
easy
A. To add custom CSS styles not available in Tailwind's default classes
B. To remove all default Tailwind styles from an element
C. To write JavaScript code inside Tailwind classes
D. To create animations automatically without extra code
Solution
Step 1: Understand Tailwind's default classes
Tailwind provides many utility classes but may not cover every CSS property you need.
Step 2: Purpose of arbitrary properties
Arbitrary properties let you write any CSS property and value inside square brackets to extend Tailwind easily.
Final Answer:
To add custom CSS styles not available in Tailwind's default classes -> Option A
Quick Check:
Arbitrary properties = custom CSS in Tailwind [OK]
Hint: Think: 'Add any CSS style directly' [OK]
Common Mistakes:
Confusing arbitrary properties with removing styles
Thinking it runs JavaScript
Assuming it creates animations automatically
2. Which of the following is the correct syntax to set a CSS property scroll-margin-top to 2rem using Tailwind's arbitrary properties?
easy
A. scroll-margin-top-[2rem]
B. [scroll-margin-top=2rem]
C. scroll-margin-top:2rem
D. [scroll-margin-top:2rem]
Solution
Step 1: Recall Tailwind arbitrary property syntax
It uses square brackets with property and value separated by a colon, like [property:value].
Step 2: Match syntax to options
Only [scroll-margin-top:2rem] matches the correct format: [scroll-margin-top:2rem].
Final Answer:
[scroll-margin-top:2rem] -> Option D
Quick Check:
Syntax = [property:value] [OK]
Hint: Use square brackets and colon for property:value [OK]
Common Mistakes:
Using equal sign instead of colon
Placing brackets incorrectly
Omitting brackets entirely
3. What will be the rendered style of this HTML element?
5. You want to add a custom CSS property scroll-padding-left with value 3rem to a div using Tailwind. Which class should you use, and why might this be necessary?
hard
A. scroll-padding-left-[3rem] because brackets go around the value only
B. [scroll-padding-left:3rem] because Tailwind does not have a built-in class for this property
C. scroll-padding-left-3rem because Tailwind supports all scroll-padding classes by default
D. scroll-padding-left:3rem because colons are allowed directly in class names
Solution
Step 1: Recognize unsupported CSS property
Tailwind does not provide default classes for scroll-padding-left.
Step 2: Use arbitrary property syntax
To add unsupported CSS, use square brackets with property and value separated by colon: [scroll-padding-left:3rem].
Final Answer:
[scroll-padding-left:3rem] because Tailwind does not have a built-in class for this property -> Option B
Quick Check:
Unsupported CSS = use arbitrary property [OK]
Hint: Use brackets with property:value for unsupported CSS [OK]
Common Mistakes:
Assuming Tailwind has built-in class for all CSS
Placing brackets only around value
Using colon directly in class without brackets
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.