Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the frame model in CSS

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what the CSS frame model is, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Overview of CSS Box Model

The innermost part of the element box is the actual content, and the direct unbounding mode is the inner margin. The inner margin presents the backup of the element. The margin of the inner margin is the border. Outside the border is the outer margin, which is translucent by default, so it will not obscure any subsequent elements.

It implies that the scenery matching is used in the area composed of form, inner margin and frame.

The inner, border, and outer margins are all optional, and the default value is zero. However, many elements will have the outer and inner margins set by the user-acting format table. You may override these browser styles by setting the element's margin and padding to zero. This can be done separately, or you may use a general decision maker to equip all elements:

* {margin: 0; padding: 0;}

In CSS, width and height refer to the width and height around the content. Increasing the inner margin, border, and outer margin does not affect the size of the content area, but increases the total size of the element box.

If each side of the box has an outer margin of 10 pixels and an inner margin of 5 pixels. If you want the element box to reach 100 pixels, set the width of the content to 70 pixels, as shown below:

# box {width: 70px; margin: 10px; padding: 5px;}

Hint: inner margins, borders, and outer margins can be used on all sides of an element, or on straight edges.

Implied: the outer margin may be negative, not to mention that a negative outer margin should be used in many cases.

The above is all the content of the article "what is the frame Model in CSS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report