Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  Thin Border  CSSNext Question:  CSS Navigation  CSS

Question Question about Horiz. Center FAQ ( SitePoint Forums CSS )
Updated: 2008-11-23 03:50:02 (2)
Question about Horiz. Center FAQ

I am trying center all content horizontally by using the information from the FAQ's sticky and I'm a little confused. I have a color in the containerdiv class that will fill the screen while the rest of page is centered. Should the margins be auto? The 2 pixel measurements in the instructions are what are confusing me. The page is still in the beginning stages and is not online. Here's the HTML and CSS. Any help on what I'm not getting in the FAQ instructions would be great.

John


HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="superrigs.css" rel="stylesheet" type="text/css">
</head>

<body>
<div class="containerdiv">
<div id="homeheader"><img src="images/header.gif" alt="superrigs header" width="800" height="105"></div>
<div id="homecontent"></div>
<div id="homefooter"></div>
</div>
</body>
</html>


CSS:

body {
text-align: center;
margin: 0px;
padding: 0px;
min-width:800px;/* stop mozilla sliding off the edge */
}
.containerdiv {
margin-right: auto;
margin-left: auto;
width: 800px;
positive: relative;
text-align: left;
background-color: rgb(255, 204, 51);
border: thin solid #FF0000;

}
#homeheader {
border-bottom-width: 5px;
border-bottom-style: solid;
border-bottom-color: rgb(0, 51, 153);
height: 105px;
width: 800px;
}

Answers: Question about Horiz. Center FAQ ( SitePoint Forums CSS )
Question about Horiz. Center FAQ

OK,

I found I made a mistake on the CSS. The color I had designated for the .containerdiv should have been in the body tag. But still confused about the 2 different pixel measures in the FAQ.

John

jodmcc

Question about Horiz. Center FAQ

Quote:
But still confused about the 2 different pixel measures in the FAQ.
So am I John To what are you referring exactly? Is there a typo in there somewhere.

Paul
Edit:


Found it Did you mean where i specified 755px for the width. Yes it should be 775px the same as the min-width in the body. It wouldn't have harmed anything as it would have just given moz a margin on the left edge when resized smaller.
Changes it now and thanks for spotting it (if that's what you were talking about ).

Paul O'B

Previous Question:  Thin Border  SitePoint Forums  CSSNext Question:  CSS Navigation  SitePoint Forums  CSS

- Source: Question about Horiz. Center FAQ SitePoint Forums CSS
- Previous Question: Thin Border SitePoint Forums CSS
- Next Question: CSS Navigation SitePoint Forums CSS





AllQuests.com


Best dedicated servers   Top dedicated servers   Cheap dedicated servers   Linux dedicated servers   Windows dedicated servers   Unmetered dedicated servers