Forum Moderators: open
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
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]