PagodNaUtak
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...
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>
Because you do not have 'position' statement in those definitions. http://www.w3schools.com/css/css_positioning.asp
ASKER
but I do insert a position here:
img.left, img.center, img.right{
border:1px solid black;
postion:relative;
margin:0px;
}
img.left, img.center, img.right{
border:1px solid black;
postion:relative;
margin:0px;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
set positioning to the related objects (own object and the parent one too)
ASKER
Wrong spelling of the word pc