CSSPositionValue.y

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The y property of the CSSPositionValue interface returns the item's position along the vertical axis.

Syntax

var y = CSSPositionValue.y

Value

A CSSNumericValue.

Example

The following example positions a container <div> 5 pixels from the top and 10 pixels from the left of the page.

let replaceEl = document.getElementById('container');
let position = new CSSPositionValue(CSS.px(5), CSS.px(10));

someDiv.attributeStyleMap.set('object-position', position);
console.log(position.x.value, position.y.value);

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
y
Experimental
Chrome Full support 66Edge Full support 79Firefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support 9.0

Legend

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See Also