Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

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?

share|improve this question
    
Not found in the specification: w3.org/TR/css3-background/#the-background-position – Rob W Mar 11 '12 at 9:18
    
@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) – Guile Mar 15 '12 at 17:25
1  
Firefox is the only major browser that does not support this. Go to bugzilla.mozilla.org/show_bug.cgi?id=550426 and vote. – Semra Dec 8 '12 at 9:40
    
You can vote on this issue to try and convince the Firefox developers to include it in Gecko – Andy E Jun 20 '13 at 8:40
    
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.116 – Grzegorz Luczywo Jul 16 '14 at 17:52
up vote 24 down vote accepted

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.

share|improve this answer
    
Browser support is pretty good, however: Firefox doesn't support it at all :( – Husky Feb 17 at 12:52

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 www-style@w3.org 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.

share|improve this answer
1  
OK, with all your links, I'm now sure that it won't be standard for a long time! Thanks! – Guile Mar 15 '12 at 17:25
8  
Good answer, not the one I wanted to hear though. :/ Upvoted. – Madbreaks Jun 6 '12 at 18:49
99  
Simplifying code for sprites is too weak a case? Oh well. – egid Dec 27 '12 at 17:46
6  
short sighted people who shouldn't be the ones where they are.. – Muhammad Umer Dec 6 '13 at 1:02
1  
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 :/ – tzi May 26 '14 at 13:30

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

share|improve this answer
7  
Browser support (as history and Internet Explorer shows) doesn't have necessarily have anything to do with the standards – Yi Jiang Mar 11 '12 at 10:01
    
that's exactly why I'm added 'in some sense' ) nevertheless, those properties are non-standard. Though quite useful ) – shabunc Mar 11 '12 at 10:10
    
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. – Guile Mar 15 '12 at 17:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.