Is background-position-x (background-position-y) a standard W3C CSS property?
Asked Answered
M

3

87

I'm worried about background-position-x and background-position-y. Gecko (Firefox) and Presto (Opera) don't support them, but Webkit (Chrome, Safari) does...

Does anyone know (with official references) if this is (or will be) included in the standard?

Macswan answered 11/3, 2012 at 9:3 Comment(6)
Not found in the specification: w3.org/TR/css3-background/#the-background-positionRodmur
@Joseph I did and didn't find things from W3C. But it was the same for <canvas> a while ago... And now it is in standards I guess (I didn't verify)Macswan
Firefox is the only major browser that does not support this. Go to bugzilla.mozilla.org/show_bug.cgi?id=550426 and vote.Harleigh
You can vote on this issue to try and convince the Firefox developers to include it in GeckoBreakfront
These properties are non-standard. Also note that Webkit (Safari, Chrome) implements them but they return different values than the standard background-position if the user zoomed the page. While background-position remains consistent when zooming, background-position-[xy] adjusts to the zoomed currently rendered coordinates. Tested on Chromium 34.0.1847.116Inlet
Please consider the new answer with April 2014 update from W3C. These properties ARE now part of the standard.Staghound
E
30

background-position-x and background-position-y are now part of the level 4 of Backgrounds and Borders standard.

RESOLVED: background-position-x/-y, background-repeat-x/-y approved for level 4 of backgrounds and borders.

Ectomorph answered 25/7, 2014 at 8:14 Comment(1)
Browser support is pretty good, however: Firefox doesn't support it at all :(Supercharger
T
129

Splitting background-position into -x and -y was proposed for CSS 3 but it got rejected as the working group “considered the use case too weak to introduce new properties for.” Additionally, there seemed to be some ambiguity concerns with multiple background images and CSSOM, the API behind CSS. I’m not sure how WebKit and Trident did implement them and how they addressed these concerns.

The CSS WG blob has just reported yesterday that there will be “no change to background-position or transform-origin syntaxes.” The reason is probably due to not getting any further delays.

Maybe it will get added to CSS 4. There is a current thread on the [email protected] mailing list that you might find interesting.


Update    So apparently these properties have been approved for CSS 4 (see [CSSWG] Minutes Telecon 2014-04-16):

RESOLVED: background-position-x/-y, background-repeat-x/-y approved for level 4 of backgrounds and borders.

Tripping answered 11/3, 2012 at 9:51 Comment(6)
OK, with all your links, I'm now sure that it won't be standard for a long time! Thanks!Macswan
Good answer, not the one I wanted to hear though. :/ Upvoted.Indention
It seems that only Firefox doesn't support it, since Opera uses Blink rendering engine snook.ca/archives/html_and_css/background-position-x-y. Maybe it could be great that w3c standardizes what browsers have already implemented :/Abundant
Please consider the new answer with April 2014 update from W3C. These properties ARE now part of the standard.Staghound
what about the real support for this?Alcahest
@egid So true! In fact I got here researching options to make my sprite handling code simpler!Quattrocento
E
30

background-position-x and background-position-y are now part of the level 4 of Backgrounds and Borders standard.

RESOLVED: background-position-x/-y, background-repeat-x/-y approved for level 4 of backgrounds and borders.

Ectomorph answered 25/7, 2014 at 8:14 Comment(1)
Browser support is pretty good, however: Firefox doesn't support it at all :(Supercharger
C
1

I guess in some sense you've already answered your own question. No, both background-position-x and background-position-y are nonstandard.

Copulative answered 11/3, 2012 at 9:14 Comment(3)
Browser support (as history and Internet Explorer shows) doesn't have necessarily have anything to do with the standardsExcrescent
that's exactly why I'm added 'in some sense' ) nevertheless, those properties are non-standard. Though quite useful )Copulative
Well I would have needed it, but as they won't be included in any standard for a long time, I prefer to have a longer CSS that works in every browser, that a shorter CSS that is buggy for FF, Op.Macswan

© 2022 - 2024 — McMap. All rights reserved.