191 words
1 minute
Stylish Flag

Challenge Overview#

The page loads a nearly empty HTML with just a single div.flag:

<link rel="stylesheet" href="csss.css">
<div class="flag"></div>

The CSS paints “pixels” by using a huge box-shadow list on an 8x8 base square:

.flag {
width: 8px;
height: 8px;
background: #0f0;
box-shadow:
264px 0px #0f0,
1200px 0px #0f0,
0px 8px #0f0,
32px 8px #0f0,
... many more offsets ...
1200px 64px #0f0;
}

Each xpx ypx #0f0 entry draws another 8x8 green square at that offset. Together they form pixel art that encodes the flag.

Solution#

Step-by-Step#

  1. Open the page and launch your browser’s DevTools (F12).
  2. In the Elements panel, select the <div class="flag">.
  3. In the Styles panel, add a scaling rule to make the pixel art readable:
.flag {
transform: scale(6);
transform-origin: top left;
}
  1. If the background makes it hard to read, also add:
body { background: #000 !important; }
  1. Once scaled, the pixel grid clearly renders text - read off the CTF flag.

Why This Works#

  • The box-shadow list is a classic CSS “pixel art” trick: one base element plus many shadows to draw pixels.
  • All offsets are multiples of 8px in both x and y, creating a grid of 8x8 pixels.
  • Scaling the element makes the rendered text legible without changing the page semantics.

Flag#

v1t{CSS_P1X3L_ART}
Stylish Flag
https://daryx.vercel.app/posts/v1tctf-2025-stylish-flag/
Author
Daryx
Published at
2025-01-10
License
CC BY-NC-SA 4.0