Text✨ Premium

3D Extrude Text

A stack of 12 graduated text-shadow layers and a hover translate create the illusion of an extruded block — 3D relief in pure CSS, zero JavaScript.

CSS3DHover

You'll get access to the interactive demo with a free account.

This effect is part of Effect.Labs — 811 vanilla effects, some free, some premium. Text has 56 effects, including 4 free. Explore the category →

3 usage examples

Landing page hero — Creative studio or agency — 3D Extrude Text example 1

① Landing page hero — Creative studio or agency

WhenA large full-width H1 on the dark landing page of an agency, studio, or personal portfolio.
WhyThe effect is pure CSS — the heading stays semantic, indexable, and the extrusion activates on hover without adding to the JS bundle or creating any canvas.
Settingsfont-size: 5rem; font-weight: 900 on the element; 12 px depth (default); transition .25s for snappier response on a primary headline.
Arcade logotype — Full-screen game title — 3D Extrude Text example 2

② Arcade logotype — Full-screen game title

WhenA game name or competition title displayed full-screen on a black background — 'ARCADE', 'CHAMPIONS', a gaming event name.
WhyAt 5 rem and above, each of the 12 shadow layers is distinctly visible to the naked eye; the hover <code>translate(-8px, -8px)</code> lifts the slab like an engraved metal block, making every mechanism of the effect immediately readable.
Settingsfont-size: 5.5rem; font-weight: 900; color: #f59e0b (gold/amber for a warm metal effect); shadow palette from bright gold to deep brown (#d97706 → #451a03); transition .3s; 12 px depth (default).
Section heading — Long-form article in dark mode — 3D Extrude Text example 3

③ Section heading — Long-form article in dark mode

WhenIn a long-form article, H2 headings animate on mouse-over to signal sections and pace the reading experience.
WhyA single <code>&lt;span&gt;</code> and a few CSS lines are enough — compatible with any CMS without injecting JS, and with no impact on load performance.
Settingsfont-size: 3rem; font-weight: 700; color: #f59e0b (amber for a warm editorial tone); transition .35s for a more contemplative pace.

How it works

The effect relies on a stack of text-shadow layers. At rest, 4 shadows each offset by 1 px (from blue-indigo #4f46e5 to deep violet #312e81) sketch a minimal volume. On hover, 12 layers take over: each shadow advances 1 px further — apparent depth reaches 12 px — and colors slide progressively toward near-black (#0f0d24), simulating the front face and lateral sides of a solid extruded block.

Half the illusion comes from the transform: translate(-8px, -8px) applied on hover: the text shifts up and left, uncovering the stacked shadows that were hidden behind it. The eye reads this offset as a physical lift. The final layer — rgba(0,0,0,.5) 13px 13px 20px with a large blur radius — acts as a cast shadow that anchors the block in space.

Everything animates via a single transition: .3s on the base selector: the browser interpolates transform and text-shadow simultaneously without JavaScript or requestAnimationFrame. The element must be rendered as display: inline-block — applied here via .demo-text span — for transform to take effect on inline text.

Accessibility

  • prefers-reduced-motion: no handling in the code — transition and translate always play. Add manually if needed: @media (prefers-reduced-motion: reduce) { .text-3d-extrude { transition: none } }.
  • Face contrast: #6366f1 (indigo-500) on #0a0a0f gives a ratio of ~4.3:1 — valid WCAG AA for large text (≥ 3:1) but slightly under the 4.5:1 threshold for body text. Switching to #818cf8 (indigo-400) raises the ratio to ~5.9:1.
  • The <span> with cursor: pointer is not keyboard-focusable: no :focus-visible is defined. If the extrusion should respond to keyboard navigation, convert to <button> or add tabindex="0" and a :focus-visible state.
  • No aria attributes in the base code — visible text is directly accessible to screen readers, which is correct for a purely decorative effect on static text. No aria-hidden needed.

Browser compatibility

Requires text-shadow (IE10+) and transform — supported in all modern browsers and most older ones. Zero external dependencies.

Chrome 36+✓ Full
Firefox 35+✓ Full
Safari 9+✓ Full
Edge 14+✓ Full
Mobile iOS✓ No hover — rest state only
Android Chrome✓ No hover — rest state only

Without hover (mobile, touch), the text stays in its rest state — 4 subtle shadows, no translate. No visual breakage; the text remains readable and the effect is silent.

The code

HTML structure to paste into your page (CSS + JS available with a premium account):

index.html — structure
<div class="demo-preview">
  <!-- Replace with your content -->
  <span class="demo-text text-3d-extrude">EXTRUDE</span>
</div>
🔒 Unlock the full code — from €2.99 the first month

Full HTML + CSS + JS, copy-paste ready — with hundreds of premium effects.

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
color on .text-3d-extrude #6366f1 Front face color of the text. Also update the text-shadow hues accordingly (they are darker variants of this color).
text-shadow (hover state, layers 1–12) 12 layers, 1 px each Layer count = depth in px. 6 layers = subtle relief, 18 = thick wall. If you reduce, also reduce the translate offset (e.g. 6px instead of 8px).
transform: translate(-8px, -8px) in :hover -8px up, -8px left Lift distance. Increase to accentuate the lift. Flip signs (+8px, +8px) to extrude toward the bottom-right.
transition on .text-3d-extrude .3s Animation duration. .15s = snappy and sharp. .5s = cinematic. Replace with transition: none to respect prefers-reduced-motion.
font-size on .demo-text 2.5rem Below 1.8rem, the 12 one-pixel layers blend together visually. Recommended: ≥ 2rem for readable relief.
font-weight on .demo-text 800 High weights (700–900) maximize the visible extrusion surface. Below 600, the lateral shadow sides are too thin to distinguish.
text-shadow (rest state, layers 1–4) 4 layers, 1 px each Volume at rest before hover. Reduce to 1–2 layers for a near-flat look, or increase to 6 for permanent depth even without interaction.

FAQ

Partially. The translate(-8px, -8px) shifts the whole block at once and shadows stay aligned — the relief is consistent. However, shadows at the end of the first line may overlap the start of the second. For the cleanest result, apply the class to individual line spans or use white-space: nowrap.
Flip the signs. For bottom-right: transform: translate(8px, 8px) and all text-shadow offsets positive (1px 1px 0, 2px 2px 0, …). For a vertical-only extrusion: translate(0, 8px) with offsets 0 1px 0, 0 2px 0, ….
Yes — just change font-family on the parent element. Variable fonts even let you animate font-weight in parallel via transition: .3s font-weight and :hover { font-weight: 900 }, visually amplifying the extrusion by thickening the front face.