W3C home > Mailing lists > Public > www-style@w3.org > September 2010

[css3] background-origin question

From: Nicholas Morgan <nimorgan@gmail.com>
Date: Wed, 1 Sep 2010 09:57:56 -0400
Message-Id: <77DDF3E8-02B3-4DAE-BE98-58EE794BE059@gmail.com>
To: www-style@w3.org
Hello Everyone,

I was skimming through the CSS3 spec and really enjoying what I am seeing.

When I saw "background-origin" (http://www.w3.org/TR/css3-background/#the-background-origin) I got really excited; however, the more I read the more I was disappointed.  I'm excited that I can pass it key words and translate the origin to specific areas inside the element.  But for me it was the same as having "background-position" but only allowing me to have top, right, bottom & left.

I was wondering if there was a specific reason for not allowing values? For example:

background-origin: 100% 100%;

background-origin: 20px 34em;

Here is an example use case:

I have a link with simple text inside of it. The link is inline so its width will expand and contract with the amount of text.

a {
 display: inline;
 padding-right: 40px;

Now I want to position a background image -10px of the top right corner of the element. There is currently no way, that I am aware of, to accomplish this task.

If "background-origin" allowed values, I could do the following:

a {
 display: inline;
 padding-right: 40px;
 background-origin: 100% 0%;
 background: transparent url('icon.gif') no-repeat -10px 0px;

This would translate the origin from the top left corner to the top right and the image would appear -10px off the top right corner.

The only thing, I can think of, that would hinder this would be expressing another set of value pairs inside of short hand notation for "background".

I believe that all comments and suggestions have been closed for this particular topic since June 16th. So I just wanted to know what I was missing?

Thanks for all of your time and hard work.

-- Nick

Nick Morgan
Received on Wednesday, 1 September 2010 15:32:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:47 UTC