Skip to main content
HTML Validation

CSS: “perspective”: “0” is not valid, only values greater than “0” allowed.

About This HTML Issue

The CSS perspective property does not accept 0 as a valid value. It must be either none or a positive length greater than zero.

The perspective property defines the distance between the viewer and the z=0 plane, which determines the intensity of 3D effects on child elements. A value of 0 is mathematically undefined (it would place the viewer directly on the plane), so the specification rejects it. If the goal is to remove perspective entirely, use none. If the goal is a very strong perspective effect, use a small positive value like 1px.

The property applies to the element's children, not the element itself. A smaller value creates a more dramatic 3D effect, while a larger value creates a subtler one.

Invalid example

<div style="perspective: 0;">
  <div style="transform: rotateY(45deg);">Content</div>
</div>

Valid examples

To disable perspective:

<div style="perspective: none;">
  <div style="transform: rotateY(45deg);">Content</div>
</div>

To apply a strong (but valid) perspective:

<div style="perspective: 1px;">
  <div style="transform: rotateY(45deg);">Content</div>
</div>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries