<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/translatez--lzse02fme" -->

---
title: translateZ() | daily.dev
description: The CSS translateZ() function moves elements along the Z-axis to simulate depth in 3D space. It requires either the perspective CSS property on a parent...
canonical: https://daily.dev/posts/translatez--lzse02fme
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: translateZ() | daily.dev
og:description: The CSS translateZ() function moves elements along the Z-axis to simulate depth in 3D space. It requires either the perspective CSS property on a parent...
og:url: https://daily.dev/posts/translatez--lzse02fme
og:image: https://api.daily.dev/og/posts/lZsE02FMe.png
og:image:alt: translateZ()
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# translateZ()

**[CSS-Tricks](https://daily.dev/sources/css_tricks)** · 4 min read · 0 upvotes · 0 comments

## Summary

The CSS translateZ() function moves elements along the Z-axis to simulate depth in 3D space. It requires either the perspective CSS property on a parent element or the perspective() function applied before the transform to be visually effective. Positive values bring elements closer to the viewer; negative values push them away. The difference between the perspective property (applies to all children) and the perspective() function (applies to a single element, must come first) is explained with code examples. Additionally, translateZ(0) can be used as a GPU-acceleration hack to shift rendering off the CPU, reducing animation flickering and improving performance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://css-tricks.com/almanac/functions/t/translatez>

## Similar posts on daily.dev

- [CSS-Tricks](https://daily.dev/posts/css-tricks-k7p0pcvjd) · CSS-Tricks · 51 upvotes · 3 comments
- [translateX\(\)](https://daily.dev/posts/translatex--2gqlsumly) · CSS-Tricks · 0 upvotes · 0 comments
- [translate\(\)](https://daily.dev/posts/translate--jgrc3wuih) · CSS-Tricks · 5 upvotes · 2 comments
- [translateY\(\)](https://daily.dev/posts/translatey--3m9u1oajs) · CSS-Tricks · 0 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/translatez--lzse02fme)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"translateZ()","url":"https://daily.dev/posts/translatez--lzse02fme","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/translatez--lzse02fme"},"datePublished":"2026-06-25T13:22:45.784Z","dateModified":"2026-06-25T13:23:27.636Z","description":"The CSS translateZ() function moves elements along the Z-axis to simulate depth in 3D space. It requires either the perspective CSS property on a parent...","image":"https://i0.wp.com/css-tricks.com/wp-content/uploads/2019/12/css-tricks-logo-gradient-outline.png","thumbnailUrl":"https://i0.wp.com/css-tricks.com/wp-content/uploads/2019/12/css-tricks-logo-gradient-outline.png","isAccessibleForFree":true,"articleSection":"CSS-Tricks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"CSS-Tricks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/css_tricks","url":"https://daily.dev/sources/css_tricks"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/translatez--lzse02fme","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,css","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"CSS-Tricks","item":"https://daily.dev/sources/css_tricks"},{"@type":"ListItem","position":3,"name":"translateZ()"}]}
```

