How does jQuery set div to vertical center and jquerydiv to vertical center?

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.