Getting Started with CSS: CSS2 box model

Source: Internet
Author: User
Tags add object window
Css

CSS2 Box Model

The box model in CSS2 is the key to the layout positioning in the design, and any selector follows the box model specification, such as <div>, <p>, <a> ... The box model contains (outer patch) margin, (background color) Background-color, (background image) Background-image, (inside patch) padding, (content) content, (border) border. The diagram below is a schematic diagram of the CSS box model

PLANE schematic

3D schematic (original: hicksdesign)

FLASH schematic model

What needs to be explained is: IE and Mozilla browser to the box model interpretation is inconsistent, resulting in our positioning difficulties, the main difference is:

IE calculates the distance between 2 Div, will calculate the 1px border, and Mozilla does not; After setting the width of the div, if you add a value to padding, ie will subtract this value in the width, and M ozilla will add this value on the width basis.



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.