On Wed, Jun 29, 2011 at 4:31 AM, Tom Livingston <tom...@gmail.com> wrote:
>
> Is it possible to position a background image on the body of a page so
> that the LEFT EDGE of the image is always at 50% of the viewport? Ive
> googled a bit but not sure im using the right search terms...
>
>
background: url(image.png) no-repeat 50% 0;

The above CSS will cause the image to be centered. For the *left edge* to be
at the center, you need to double the width of the image by adding a
transparent region on the left.
For example, if you have an image of width 200px, using an image editor add
a 200px transparent region to the left of the image. The new width of the
image will be 400px. Now apply the above CSS to align the left edge of the
image to the center of the viewport.

Regards,
Chetan Crasta
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to