I am trying to center my div on the page using the following CSS code:
.content{
width:1000px;
height:600px;
margin:auto;
margin-top:auto;
}
What I Want to Do :
I would like to achieve the same effect using jQuery within $(document).ready(function () {}. My plan is to initially hide the div by giving it a negative position, then show and animate it in document.ready with the properties mentioned above.
However, I have been struggling to make the margin:auto and margin-top:auto parameters work.
If anyone could provide guidance, it would be greatly appreciated!
This is my current approach:
http://jsfiddle.net/rgd9mwjz/
I am looking to see the div animation moving from -555px to the center of the div. How can I accomplish this?