HTML Guides for perspective
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
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
<divstyle="perspective:0;">
<divstyle="transform:rotateY(45deg);">Content</div>
</div>
Valid examples
To disable perspective:
<divstyle="perspective: none;">
<divstyle="transform:rotateY(45deg);">Content</div>
</div>
To apply a strong (but valid) perspective:
<divstyle="perspective:1px;">
<divstyle="transform:rotateY(45deg);">Content</div>
</div>
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.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries