473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Anchoring Background-Image to Different Part of Container

By default, background images are anchored to their containers at the
top left corner of both. Is there a way to anchor them to another
corner, say the top right corner of the container=the top right corner
of the background-image?

Thanks,
Jamie

Feb 12 '07 #1
6 2266
Rik
On Mon, 12 Feb 2007 20:10:34 +0100, Jamie Jackson <my******@gmail.com
wrote:
By default, background images are anchored to their containers at the
top left corner of both. Is there a way to anchor them to another
corner, say the top right corner of the container=the top right corner
of the background-image?
CSS:

background-position: [ [<percentage| <length>]{1,2} | [ [top | center |
bottom] || [left | center | right] ] | inherit
So in your case:
background-position: top right;
--
Rik Wasmus
Feb 12 '07 #2
On Feb 12, 2:18 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Mon, 12 Feb 2007 20:10:34 +0100, Jamie Jackson <mySpa...@gmail.com>
wrote:
By default, background images are anchored to their containers at the
top left corner of both. Is there a way to anchor them to another
corner, say the top right corner of the container=the top right corner
of the background-image?

CSS:

background-position: [ [<percentage| <length>]{1,2} | [ [top | center |
bottom] || [left | center | right] ] | inherit

So in your case:
background-position: top right;
--
Rik Wasmus
Thanks, Rik

Feb 12 '07 #3
Rik wrote:
>
background-position: top right;
That should be
background-position: right top;

The x-axis is always first.

--
Berg
Feb 12 '07 #4
Bergamot schrieb:
Rik wrote:
>background-position: top right;

That should be
background-position: right top;

The x-axis is always first.
No. See <http://www.w3.org/TR/REC-CSS2/about.html#property-defs>:

* A double bar (||) separates two or more options: one or more of them
must occur, in any order.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Feb 13 '07 #5
Johannes Koch wrote:
Bergamot schrieb:
>>
background-position: right top;

The x-axis is always first.

No. See <http://www.w3.org/TR/REC-CSS2/about.html#property-defs>:

* A double bar (||) separates two or more options: one or more of them
must occur, in any order.

Hmmm...
background-position: 50% 100%;

Maybe using keywords doesn't matter, but for numeric values it most
definitely does.

--
Berg
Feb 13 '07 #6
Bergamot schrieb:
Maybe using keywords doesn't matter, but for numeric values it most
definitely does.
Yes, see the production rule in Rik's post that you responded to.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Feb 13 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Stanimir Stamenkov | last post by:
Here are two cases regarding inline-level elements' line-height, padding and background, which I doesn't understand: <div style="background: black; color: white; line-height: 1.5">...
1
by: CMAR | last post by:
I have a design of a frameless page on my practice website: http://home.ne.rr.com/thespar/designerN.htm The idea is to have a #left navigation bar which is absolutely positioned and which...
1
by: Brian Conway | last post by:
I have a webform that I have a datagrid on that I want a button at the bottom of the grid to maintain its position with the datagrid, if the grid grows large then button needs to move down with it,...
3
by: Mad Joe | last post by:
Hi! I have a window form that contains 4 elements (2x2) on one panel. Those 4 elements are GroupBoxes of the exact same size, sorted like this: groupBox1 groupBox2 groupBox3 groupBox4 ...
2
by: bissatch | last post by:
Hi, I am running a w3c CSS validation check on a site in development. I have many errors saying that my CSS is not valid because I have not defined the background-color but instead left it...
0
by: daveryan78 | last post by:
Hi all, I've been getting a strange problem with anchoring on my forms. I have a form where I put on a tabControl. I set it's anchoring to Top, Bottom, Left, Right. I put a number of tabPages on...
3
by: Steve | last post by:
I have two group boxes containing labels and textboxes that are next too each other. I want the group boxes and labels and textboxes to remain portionally the same as the form is resized. I've...
3
by: marfi95 | last post by:
My application consists of basically a treeview on the left side, along with a panel control that takes up the right side. When nodes are clicked on the left, the data on the right side of the...
1
by: sklett | last post by:
I've read several articles/blogs/threads about anchoring/docking child controls in a FlowLayoutPanel. It sounds like it *should* work, but I can't get it to work for the life of me. Jon Skeet: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.