Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a simple website, and no matter what I do, there is always a weird left margin of about ten pixels, I tried setting the
CSS
margin-left:0px;
but I didn't work, please respond, any help would be welcomed and apreciated

-Jordan

HTML:
HTML
<!DOCTYPE html>
<html>
	<head>
		<meta name="author" content="Jordan 'Croug' LaPrise, Henry 'arctichenry' Schildbach, various CalcuProcessing members">
		<meta name="description" content="Minecraft network deticated to independant hosting and free minecraft for everyone!">
		<meta name="organization" content="CalcuProcessing">
		<meta charset="UTF-8">
		<title>ThisIsNotAServerMCNetwork</title>
		<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
		<link rel=StyleSheet type="text/css" href="style.css">
	</head>
	<body>
		<div id="wrap">
			<div id="bg">
					<div id="header">
					</div><!-- header -->
					<div id="navbox">
						Test Text
						<!-- <a href="index.php" class="nav">Home</a> -->
					</div><!-- navbox -->
				<div id="scroll">
				</div><!-- scroll -->
			</div><!-- bg -->
		</div><!-- wrap -->
	</body>
</html>


CSS:
CSS
#wrap{
	margin-left:0px;
	margin-right:0px;
}
#header{
	position:fixed;
	height:18px;
	width:100%;
	background-image:url("images/header.png");
	color:black;
	padding:2px;
}
#navbox{
	position:fixed;
}
a.nav{
	text-decoration:none;
}
Posted
Comments
Richard C Bishop 4-Feb-13 12:47pm    
If margin-left is set to 0, then it is 0. Is it padding that is messing you up by chance? Try setting the padding on both sides to 0 as well and see what that does for you.
Sicppy 4-Feb-13 12:54pm    
Thanks for your suggestion but that doesn't seem to solve my problem
Zoltán Zörgő 4-Feb-13 13:05pm    
Be aware, that BODY and HTML also might have margin and padding settings, you should adjust them too.
Sicppy 4-Feb-13 13:07pm    
That did it, if you post that comment as an answer I will accept it
Zoltán Zörgő 4-Feb-13 13:12pm    
Done.

1 solution

Be aware, that BODY and HTML also might have margin and padding settings, you should adjust them too.
 
Share this answer
 
Comments
Thomas Daniels 4-Feb-13 13:17pm    
+5!
Richard C Bishop 4-Feb-13 13:41pm    
Nice catch, +5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900