Why left:-8px and left :-4px not working.

Please see the below code.

I do not know why the left:-8px is not working.

thanks in advance...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
<head>

  <style> 
   
   div{
	margin:auto;
	width:500px;
   }
   
	img.left, img.center, img.right{
		border:1px solid black;
		postion:relative;
		margin:0px;		
	}
	
	div img.left{		
		width:200px;
		height:200px;
	}
	
	div img.center{		
		width:150px;
		height:150px;
		left:-4px;
	}
	
	div img.right{		
		width:100px;
		height:100px;
		left:-8px;
	}	

	
  	
	
  </style> 
  <script src="http://code.jquery.com/jquery-1.5.js"></script> 
  <script type="text/javascript">
	$(document).ready(function(){
		$("#next").click(function(){
			$("img").animate({"left":"-=50px"}, "slow");
		});	
	});	
  </script>
  
</head> 
<body> 
	<div>
		<img src="images/folder_home.png" alt="folder home" class="left move" >
		<img src="images/home_black.jpg" alt="folder home" class="center move">
		<img src="images/home_title.bmp" alt="folder home" class="right move" >
		<p id="next">Next</p>
	</div>	
	
</body> 
</html>

Open in new window

LVL 8
PagodNaUtakAsked:
Who is Participating?
 
PagodNaUtakAuthor Commented:
found it:

wrong spelling of position in my css...
0
 
Dave BaldwinFixer of ProblemsCommented:
Because you do not have 'position' statement in those definitions.  http://www.w3schools.com/css/css_positioning.asp
0
 
PagodNaUtakAuthor Commented:
but I do insert a position here:

img.left, img.center, img.right{  
                border:1px solid black;  
                postion:relative;  
                margin:0px;              
}  
0
 
enkorCommented:
set positioning to the related objects (own object and the parent one too)
0
 
PagodNaUtakAuthor Commented:
Wrong spelling of the word pc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.