My code is like this.

```
<div class="outer">
    <div class="inner">some text here
    </div>
</div>

```

CSS:

```
.outer {
    max-width:1024px;
    background-color:red;
    margin:0 auto;
}
.inner {
    width:50px;
    border:1px solid white;
    position:fixed;
}

```

The inner `div`, which is positioned `left` by default, needs to be positioned against the `right` w.r.t. the outer `div` and not to the page itself.

If I style it to be `right:0px;`, then it aligns `0px` from the browser's right, not the outer `div`'s right. 

NOTE : My outer `div` is not fixed width; it adjust as per screen resolution. It's a responsive website design.