Link to home
Start Free TrialLog in
Avatar of PagodNaUtak
PagodNaUtakFlag for Philippines

asked on

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

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Because you do not have 'position' statement in those definitions.  http://www.w3schools.com/css/css_positioning.asp
Avatar of PagodNaUtak

ASKER

but I do insert a position here:

img.left, img.center, img.right{  
                border:1px solid black;  
                postion:relative;  
                margin:0px;              
}  
ASKER CERTIFIED SOLUTION
Avatar of PagodNaUtak
PagodNaUtak
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
set positioning to the related objects (own object and the parent one too)
Wrong spelling of the word pc