calculatePosition can now accept css instead of just position