Reputation: 154
I want to execute a function on one element in the center of the window, and another function when leaving the element in the center. So how to make sure the HTML element is in the center of the window?
Upvotes: 1
Views: 115
Reputation: 1295
Use following style attributes:
display: table-cell; vertical-align:middle; text-align:center; height:100%; width:100%;
Hope this solves!
Upvotes: 1