Click here to Skip to main content
12,948,130 members (71,701 online)
Rate this:
 
Please Sign up or sign in to vote.
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
margin-left:0px;
but I didn't work, please respond, any help would be welcomed and apreciated

-Jordan

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:
#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 4-Feb-13 6:43am
Sicppy1.6K
Comments
richcb 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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Be aware, that BODY and HTML also might have margin and padding settings, you should adjust them too.
  Permalink  
Comments
ProgramFOX 4-Feb-13 13:17pm
   
+5!
richcb 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,344
CHill60 3,275
Maciej Los 2,703
Jochen Arndt 1,935
ppolymorphe 1,795


Advertise | Privacy | Mobile
Web02 | 2.8.170524.1 | Last Updated 4 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100