How does jQuery set div to vertical center and jquerydiv to vertical center?
How does jQuery set div to center horizontally and vertically:
CSS can also be used to achieve the horizontal vertical center effect of div, but sometimes it may need to be dynamically adjusted. Next we will introduce how to use jQuery to achieve the horizontal vertical center effect of objects. Let's look at a code example first:
<! DOCTYPE html>
The preceding Code centers the div horizontally and vertically in the window, regardless of whether the window size is adjusted. Some may say that this is vertical center in the window. How to Implement vertical center of a div in a common object is as follows:
<! DOCTYPE html>
The above code implements the horizontal vertical center effect of the word div in the parent div.
Original address: http://www.51texiao.cn/jqueryjiaocheng/2015/0427/244.html