Wednesday, June 9, 2010

"pt" and "px" - are different units of measurement in CSS

The unit "pt" stands for Points and "px" stands for pixels.

When I happened to position a particular element on the XPage beneath a button on the fly, when I click the same, I happened to see all weard behaviours...

All of my javascript alerts where correct values but still the element which I repositioned was relocated to a unexpected location on the screen.

This was because of the difference between these units...

The position attribute that I got from my button was on points (pt) and I actually was assiging them back to the dynamic element on pixels (px) ... hence there was a mismatch and this occured with XPages on Notes Client..

the relation between pt and px is as follows,

pt = 0.75px

Note : Its seems like your style sheets must include pt if and only if its a print style sheet ...
em,mm,px and now pt... I dont know how many else are there...  Got to find them:)

No comments:

Post a Comment