.css() has been in jQuery since Version 1.0 but the
position CSS property was included in jQuery Version 1.2.
Function For Center Aligning the Element
Writing the function is not really difficult, here is the function below for Center Aligning:
Function For Bottom Aligning the Element
And for Bottom Aligning:
In the above code(s)
FunctionName is your desired function name and
#ElementName is the id of the element which you want to center or bottom align, you can even use this keyword here.
After writing the function, simply call it.
Though this method works most of the time, but still if you see it not functioning properly or not perfectly center or bottom aligning the element, then manually add some numerical pixel values to the variables used above.