Shadow Depth
Part of the Fundamentals section of Coddy's Tailwind CSS journey. Lesson 18 of 55.
A shadow paints outside a surface without reserving layout space. Tailwind offers named sizes such as shadow-sm; bracket syntax can express a measured shadow, such as shadow-[0_2px_0_black] for a crisp black shadow two pixels down.
<div class="bg-white p-4 shadow-[0_2px_0_black]">Museum sample</div>Underscores inside this arbitrary value represent spaces in the CSS value. The values are horizontal offset, vertical offset, blur and color. A zero blur makes the edge sharp; removing a shadow does not remove the border.
Challenge
EasyGive the ticket a crisp black shadow with no horizontal offset, a 6-pixel downward offset and zero blur.
Keep the supplied content and element IDs. Edit the HTML utility classes or the requested CSS. Click Run preview to refresh the preview after edits, then use Check/Run code to grade your work.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="target" class="bg-white p-4">Admit one</div>
</body></html>
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet Tailwind
A Styled First RunChoosing UtilitiesCombining UtilitiesThe Local StylesheetRecap: Meet Tailwind