Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

centering web page at res 1024?

Status
Not open for further replies.

buachil

Technical User
Oct 25, 2005
7
IE
Any ideas how I could center this web page Or to get the (fixed) sidebar to move ovef to the right - to join the rest of the page. At res 800x600 it looke ok, but at 1024 I can't get everything centered. Thanks.

The css code is:
CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"

<head>
<!--#include virtual="/meta/index.txt"-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>

<style type="text/css">
<!--
body {
margin : 0;
padding : 0;
background : #999999;
color : white;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : medium;
width : 790px;
margin-right : auto;
margin-left : auto;

}
.invisible {
display : none;
}
#fixed {
position : absolute;
top : 0;
left : 0;
width : 10em;
height : 100%;
background : #ffffcc;
color : black;
}
body > #fixed {
position : fixed;
}
#header {
margin-left : 9em;
padding-left : 6em;
background : #fff000;
color : #000fff;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 12px;
line-height : 1.5;
}
#content {
margin-left : 10em;
padding : 1em;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : medium;
line-height : 1.5;
}
code, pre {
font-family : monospace;
font-size : large;
font-weight : bold;
background : transparent none;
color : yellow;
}
.center {
text-align : center;
}
h1 {
font-size : 4em;
text-align : center;
}
h2 {
margin-top : 2em;
}
h3 {
margin-top : 1em;
text-align : center;
}
h4 {
margin-top : 10px;
text-align : center;
}
a:link {
background : transparent none;
color : #999999;
}
a:visited {
background : transparent none;
color : #666666;
}
a:active {
background : transparent none;
color : #99ff00;
}
a:hover {
background : transparent none;
color : #000000;
}
#fixed a {
text-decoration : none;
padding-left : 1.5em;
background : none;
font-weight : bold;
font-size : smaller;
margin-bottom : 2px;
}
#fixed a:hover {
background : none;
color : #ffcc33;
}
div.address {
border-top : 0px solid black;
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 10px;
}
div.address img {
border : 0;
text-align : left;
}

-->
</style>
<!--[if IE 6]>
<link rel="stylesheet" href="IE6hack.css" type="text/css" />
<![endif]-->
</head>
 
From the css I can hardly understand what you're trying to do. Same goes for the actual presentation of the page. What should be centered and what not? Why is the menu on the left fixed when it is actually not? Please explain some more what you want.
 
and...how can I get the vertical scroll bar over to the right of the screen at6 1024 res?
 
How about changing your current body declaration to this:
Code:
body {
  margin : 0 [b]auto;[/b]
  padding : 0; 
  background : #000000;
  color : white; 
  font-family : Verdana, Arial, Helvetica, sans-serif; 
  font-size : medium;
  width: 790px;
  [b]position: relative;[/b]
}
Added stuff is in bold.

I don't understand what you mean with the scrollbar. It is on the right side.
 
Thanks...now the page is centered..but...the sidebar is no longer fixed (it moves all the page is scrolled).
About the scroll bar, I mean that I wanted it on the right along the EDGE of screen, as in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top