Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iMasterWeb

macrumors regular
Original poster
Mar 15, 2009
158
0
Hi, this is my first try at hand-coding a site, so forgive me if this is a stupid quesiton...

I have my site set up so that there is the page div, which contains the background image that repeats depending on the size of the window. Inside of that div, I have a div where I want the content to be. I tried setting this div's left and right margins to auto so that it stays in the center, but it doesn't move. Any help is appreciated. (You can ignore the two div's inside of the content div because I don't think they're causing the problem) Here is the code:

HTML:
<html>
<head>
<LINK REL=StyleSheet HREF="stylesheet.css" TYPE="text/css" MEDIA=screen>
</head>
<body>
<div id = page>
<div id = content>
<div id = header>
<div id = logo>
<img src="Images/logo.jpg" alt="Welcome to iMasterWeb!"/>
</div>
</div>
</div>
</div>
</body>
</html>

CSS:
Code:
#page {
	width: 100%;
	height: 970px;
	background-image: url("Images/pagebackground.jpg");
	background-repeat: repeat-x;
	background-color: #999999;
}

#content {
	height: 970px;
	width: 960px;
	float: left;
        margin: 0, auto
}

#header {
    float: left;
	background: #333333;
	width: 100%;
	height: 175px;
}

#logo {
    float: left;
	padding: 25px;
	margin: 0, 0, 0, 100px;
}
 
I believe it should just be

margin:0 auto;

in the content div. the ',' is messing up that declaration
 
I believe it should just be

margin:0 auto;

in the content div. the ',' is messing up that declaration

Thanks for the help! By removing the comma and the float: left; I got it to work! Thanks a lot! :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.