Sharing an instance of CSS using Flexbox to achieve a center effect

Source: Internet
Author: User
This article to share the CSS in the use of Flexbox to achieve the center effect of the example, pay attention to the compatibility problem in IE browser, the need for friends can refer to the following

The future direction of CSS is to use the Flexbox design to solve common problems like vertical centering. Note that Flexbox has more than one way of centering, and he can also be used to sort the columns and solve the weird layout problems.

. Center-container.is-flexbox {     display:-webkit-box;     Display:-moz-box;     Display:-ms-flexbox;     Display:-webkit-flex;     Display:flex;     -webkit-box-align:center;        -moz-box-align:center;        -ms-flex-align:center;     -webkit-align-items:center;             Align-items:center;     -webkit-box-pack:center;        -moz-box-pack:center;        -ms-flex-pack:center;     -webkit-justify-content:center;             Justify-content:center;   }

Benefits:

Content can be any high-width, overflow can also perform well
Can be used for various advanced layout techniques

Also note: Ie8-9 is not supported

Need to write style on body, or need extra container
Requires a variety of vendor prefixes compatible with modern browsers
There may be potential performance issues

Related Article

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.