...

View Full Version : CSS Position



alcool9999
07-17-2010, 03:54 PM
Hi, i am simply trying to alert the left position of a css layer.

Javascript:


var Element = document.getElementById('box');
alert(Element.style.left);


CSS


#box {position:absolute;
left:150px;
top:150px;
background-color:blue;
height:100;
width:100;}


HTML


<div id="box">
</div>


The problem is the alert is blank and i can't understand why.

thanks

abduraooft
07-17-2010, 04:06 PM
The problem is the alert is blank and i can't understand why. See http://blog.stchur.com/2006/06/21/css-computed-style/

alcool9999
07-17-2010, 04:17 PM
Thanks i understand now.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum