Grow your CSS skills. Land your dream job.

Right side background-positioning

  • # January 31, 2009 at 3:58 am

    Hey there folks.

    I have an occurring nightmare when it comes to background-position, something I wish was addressed early on in the development of CSS.

    Why, Oh Why, is it impossible to put a background image X pixles from the right?

    The only thing to do is state the position in percent, like background-position: 95% 0; to get it 5% from the right side. But what if I have to do it in pixles? This is really really annoying, and I’m surprised it hasn’t been brought up in CSS 3.

    And on a side note, if the (x)html is stated as RightToLeft in the header, will that make background-position: x y; "right" ?

    # January 31, 2009 at 8:27 am
    "lookslikepat" wrote:
    And on a side note, if the (x)html is stated as RightToLeft in the header, will that make background-position: x y; "right" ?

    You can specify the direction of any element, not necessarily the header, and no, that won’t reverse the background’s anchor.

    The easiest way to overcome this issue is to add ‘white space’ to the right side of the actual image.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".