0
0
Tailwindmarkup~20 mins

Drop shadow on irregular shapes in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Drop Shadow Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
Which Tailwind class adds a drop shadow to an irregular shape?
You have an irregular shape created with an SVG inside a div. Which Tailwind CSS class will add a visible drop shadow around the shape?
Tailwind
<div class="w-40 h-40">
  <svg viewBox="0 0 100 100" class="w-full h-full">
    <path d="M10 30 Q 50 5 90 30 T 90 80 Q 50 95 10 80 Z" fill="#4ade80" />
  </svg>
</div>
Ashadow-lg
Bborder-4
Cbg-gray-200
Dring-4 ring-gray-500
Attempts:
2 left
💡 Hint
Drop shadows in Tailwind use the shadow-* classes.
🧠 Conceptual
intermediate
2:00remaining
Why might a drop shadow not appear on an irregular SVG shape with Tailwind's shadow class?
You applied the shadow-lg class to a div containing an SVG irregular shape, but no shadow is visible. What is the most likely reason?
AThe shadow-lg class requires a background color to show the shadow.
BTailwind shadows only work on text elements, not SVGs.
CThe SVG shape has transparent background and the shadow applies only to the div's rectangular box.
DThe SVG path must have a stroke color for shadows to appear.
Attempts:
2 left
💡 Hint
Think about how shadows apply to the container box, not the shape inside.
📝 Syntax
advanced
2:00remaining
Which Tailwind utility correctly applies a custom drop shadow with offset and blur?
You want a drop shadow with 4px horizontal offset, 6px vertical offset, 10px blur, and black color at 50% opacity. Which Tailwind class syntax is correct?
Ashadow-[rgba(0,0,0,0.5)_4px_6px_10px]
Bshadow-[4px_6px_10px_rgba(0,0,0,0.5)]
Cdrop-shadow-[4px_6px_10px_rgba(0,0,0,0.5)]
Dshadow-custom(4px,6px,10px,rgba(0,0,0,0.5))
Attempts:
2 left
💡 Hint
Tailwind supports arbitrary values inside square brackets with underscores for spaces.
selector
advanced
2:00remaining
Which CSS selector targets only irregular SVG shapes inside a div with Tailwind?
You want to apply a drop shadow only to SVG elements inside a div with class 'shape-container'. Which selector is correct?
Asvg.path.shape-container
B.shape-container > svg > path
Cdiv.shape-container path:first-child
D.shape-container path
Attempts:
2 left
💡 Hint
Think about selecting all path elements inside the container, no matter how nested.
accessibility
expert
2:00remaining
How to ensure drop shadow on irregular shapes does not reduce accessibility?
You added a drop shadow to an irregular SVG shape for decoration. What is the best practice to keep your site accessible?
AUse aria-hidden="true" on the SVG and provide descriptive text elsewhere.
BAdd a bright colored shadow to improve contrast for all users.
CRemove the shadow on focus to avoid distraction.
DUse drop shadow only on clickable elements with aria-label.
Attempts:
2 left
💡 Hint
Decorative elements should not confuse screen readers.