Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8537003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:47:45+00:00 2026-06-11T10:47:45+00:00

While adapting a site for right-to-left readers (such as Arabic and Hebrew languages) I’m

  • 0

While adapting a site for right-to-left readers (such as Arabic and Hebrew languages) I’m experiencing unexpected behavior in any Webkit browser when it comes to assigning a background-image to the body tag that is right aligned.

First of all, let me include an example page where this behavior can be seen:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="rtl" xmlns="http://www.w3.org/1999/xhtml" xml:lang="ar" lang="ar">
<head>
<title>Body background image right aligned</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style type="text/css">
body {
    margin: 0;
    background-image: url(http://static.convertworld.com/images/cols_yb-rtl.png);
    background-position: top right;
    background-repeat: repeat-y;
}
#header {
    height: 100px;
    background-color: blue;
}
#main {
    position: absolute;
    top: 100px;
    right: 150px;
    width: 610px;
    background-color: red;
}
#column {
    position: absolute;
    top: 100px;
    right: 0;
    width: 150px;
}
</style>
</head>
<body>
<div id="header">Header</div>
<div id="main">Main</div>
<div id="column">Column</div>
</body>
</html>

Now, make the windows smaller until a horizontal scrollbar appears. The background image will no longer be aligned to the right of the document, it will be positioned x pixels from the left where x is the width of the viewport.

The following browsers show this unexpected behavior:

  • Chrome (Win7 & WinXP)
  • Safari (Win7 & WinXP)
  • Webkit MiniBrowser, nightly build 2012-09-06 (Win7)

While IE, FireFox and Opera show the expected result where the background-image, independent of the size of the viewport, always is aligned to the right.

I’m a great Webkit fan but I havn’t find any explanation to this other than…. it’s a bug 🙁 It would be great if anyone finds another explanation to this behavior.
Basically:

  1. Does this happen to you as well?
  2. Is this due to my markup being incorrect?
  3. Are there errors in the CSS?
  4. Or… is it a Webkit bug 🙁

I should say that I’m not looking for a workaround, just a possible explanation. I’ve got a workaround already where I place an image absolute right:0 and z-index:-1.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:47:46+00:00Added an answer on June 11, 2026 at 10:47 am
    1. Yes I can repeat this effect by visiting your included link, using Chrome 21.0.1180.89 m on Windows 7 x64
    2. Your markup concerning background placement is not incorrect
    3. Your CSS concerning background placement is not incorrect
    4. I think this can be loosely defined as a “webkit bug”

    To correct this behavior and maintain the background position as top right, change your body CSS to this:

    body {
        margin: 0;
        background-image: url(http://static.convertworld.com/images/cols_yb-rtl.png);
        background-position: top right;
        background-repeat: repeat-y;
        background-attachment: fixed;
    }
    

    I believe the webkit browsers are placing the background according to the width of the viewport as you mentioned, but are also redefining “top right” when the browser is resized. After resizing, if you use the bottom scroll bar to scroll all the way to the left, you can see the background fits again, however your elements are in the wrong location. setting background-attachment to fixed will fix your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While deveoping a site (using Forms authentication and InProc sessionstate) a frequently run into
I've made a temp site to try out a script I'm adapting upon (simple
While my application works, I've found that becomes unresponsive to any commands and the
While debugging and keep pressing F5, if the source code does not exist, eclipse
While trying to build the mysql2 gem with ruby 1.9.2-p320 on Fedora 16, I
While developing an application using gwt in ecliplse crashed. Now the server is running
while looking at some code I stumbled onto: throw /*-->*/new std::exception (//... and I
While attempting to debug a job submission script, I ended up narrowing down the
While playing with standard library i've found a strange difference between python2 and python3.
While refactoring my code base I found a piece of code which I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.