Forum Moderators: open

Message Too Old, No Replies

can I load a web page aligned to the right

         

rambleon

7:42 am on Jul 28, 2008 (gmt 0)

10+ Year Member



Hi,

Is it possible to load a web page aligned to the right.?
That is if the page is wider than the display area, and i (re)load it I want to see the right hand edge first and be able to scroll left.
Thanks for any help

David

Marshall

9:27 am on Jul 28, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



rambleon, welcome to WebmasterWorld.

I assume you mean you want the right edge of the page flush with the right side of the browser window. The easiest way would be to put you entire page in a wrapper with the wrapper having a fixed width and a right margin of zero. Also, the <body> should have no right margin or padding. Your css would look something like this

body {
margin: 0;
padding: 0;
}
#wrapper {
width: 800px; /*or whatever works for you*/
margin: 0 0 0 auto; /* reads top-right-bottom-left */
/* you could also add float: right;*/
}

Marshall

DrDoc

7:07 pm on Jul 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Marshall, I think you misunderstood what was being asked.

He is asking to have the scroll start all the way to the right, which is not how browsers behave.

There is, however, a (dirty) trick to get this to work (sort of).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html>
<head>
<title>Untitled</title>
<style type="text/css">
body {
direction: rtl;
}
#wrapper {
background: green;
direction: ltr;
margin: 0;
width: 1800px;
}
</style>
</head>
<body>
<div id="wrapper">
<div style="background: yellow; float: left;">foo</div>
<div style="background: red; float: right;">bar</div>
<div style="background: blue; clear: both;">foo bar</div>
</div>
</body>
</html>

Not pretty, and only partially works. It's not exactly what you want, but it is as close as I think you can get.

[edited by: DrDoc at 7:10 pm (utc) on July 29, 2008]

rambleon

9:59 am on Jul 30, 2008 (gmt 0)

10+ Year Member



Thanks DrDoc,
I'll try your suggestion.
You'd think that with all the multilanguage that Microsoft does
the browser scrolling would also be adaptable for rtl languages.
I want to use it on a Hebrew web page.

DrDoc

5:48 pm on Jul 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well,
rtl
does just that -- reverses scrolling.

rambleon

6:55 am on Aug 3, 2008 (gmt 0)

10+ Year Member



Hi DrDoc,
I tried your solution and the page loads aligned to the right.
The problem now is that Hebrew which was displaying correctly
from right to left is now reversed ltr.