How do I get the content to be centered when the page shrinks?

Source: Internet
Author: User
Most Web sites on the Web can be centered after the page is zoomed out. For example CSDN can also.
I hope my own station can also ah my own development of the station, after narrowing, the contents of all to the upper left corner, good entanglements, I want to be the same as the mainstream AH. How should CSS be designed? or which CSS tag can be implemented? Or what method can be implemented with CSDN this function, please guide. ~~


Reply to discussion (solution)

That's because your page defaults to the left, and the narrowing is not off.
See below:

   
 
          

Define margin:0 Auto, can be left and right center

Upstairs positive solution to set Div margin:0 auto;

  • 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.