CSS Small note

Source: Internet
Author: User

1. Center element: Specify width, then margin auto

. Middle {    max-width:400px;     //width:400px; //When the browser is zoomed out and the width is less than the element width, the element is obscured, so applying max-width will automatically shrink the element to fit the browser size. This is useful for mobile browsers.    margin:0 auto;}

2. Set the display of the list element to inline element style, which can achieve the effect of navigation bar column.

3, Box-sizing:border-box

For box models, the earlier versions of IE put border and padding in width, while the CSS standard does not count, which creates a compatibility problem. The border and padding of the box model can be calculated in width with the above setting, and it is also easier to set the size of the box because there are fewer size parameters (less border and padding).

CSS Small note

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.