CSS Frame models (box model)

Source: Internet
Author: User

CSS Frame models (box model)

All HTML elements can be thought of as boxes, and in CSS, the term "box model" is used for design and layout.

The CSS box model is essentially a box that encapsulates the surrounding HTML elements, which include: margins, borders, padding, and actual content.

The box model allows us to place elements in the space between other elements and the borders of surrounding elements.

The following picture illustrates the box model:


Description of different parts:

    • Margin -Clears the border area. Margin has no background color, it is completely transparent

    • Border -padding and content around the border. The border is affected by the background color of the box

    • Padding -Clears the area around the content. Is affected by the background color of the fill in the box

    • Content-The contents of the box, displaying text and images

Excerpt from: W3cschool

Http://www.w3cschool.cc/css/css-boxmodel.html

--------------------------------------------------------------------------------------------------------------- ----------------

Boxmodule is like a courier package:

Margin: Express Plastic Packaging

Border: Express Carton

Padding: A layer of foam board that adheres to the inner wall of the carton

Content: Your Stuff


CSS Frame models (box model)

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.