** This should not be in quotation marks. In addition, you need to use terminology $(). Try the following:
$("#a").css('margin-top', $(document).height()/2 - $("#a").height()/2);
Or even better:
var $a = $("#a");
$a.css('margin-top', $(document).height()/2 - $a.height()/2);
Edit: To be clear, you cannot put it in quotation marks because it will try to set the margin-top property literally on this line. This is not true.
source
share