Skip to main content

HTML Guide

CSS: “left”: X is not a “left” value.

A non-valid value is being assigned to the left CSS property.

The left property positions an element horizontally if it is positioned (relative, absolute, fixed, or sticky). Valid values include lengths (e.g. 10px), percentages (e.g. 50%), keywords like auto, or the value inherit. Using an unsupported value (such as X, an undefined variable, or a misspelled unit) will trigger this error.

Valid left property values:

  • <length>: e.g., 10px, 2em
  • <percentage>: e.g., 50%
  • auto
  • inherit
  • initial
  • unset

Invalid example:

<div style="position: absolute; left: none;">Invalid left value</div>

Valid examples:

<div style="position: absolute; left: 20px;">20 pixels from the left</div>

<div style="position: absolute; left: 50%;">Centered horizontally</div>

<div style="position: absolute; left: auto;">Let browser decide position</div>

Be sure to replace any invalid or undefined values in the left property with standards-compliant ones as above.

Learn more:

Related W3C validator issues