多少类型的“盒模型” CSS有? [英] How many type of "Box Model" CSS have?

查看:109
本文介绍了多少类型的“盒模型” CSS有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS类型有两种类型:Box Model。CSS3有两个框模型。

How many type of "Box Model" CSS have?

推荐答案

content-box border-box content-box 是默认值。

content-box 因为CSS版本1.当使用 content-box 时,在计算框的宽度时,只有框的内容才会生效。在下面的参考中, content-box 被称为W3C框模型。

content-box is the default CSS box-model since CSS version 1. When using content-box, only the content of the box is taken in effect when calculating the width of the box. In the reference below, content-box is referred to as the W3C box model.

border-box 是Microsoft框模型的移植版本。在Internet Explorer 5及以下版本(IE6在Quirks模式下)中,IE将元素的宽度视为边框,填充和框的内容区域的组合宽度。在下面的参考中, border-box 被称为W3C框模型。

border-box is the ported version of the Microsoft box model. In Internet Explorer 5 and below (IE6 in Quirks mode), IE considered the width of the element as being the combined width of the border, padding and content area of the box. In the reference below, border-box is referred to as the W3C box model.

除非通过 box-sizing 属性指定,否则code> border-box 框模型:

No element uses the border-box box model unless specified via the box-sizing property, as such:

box-sizing: border-box;



参考图片






Reference Image


这篇关于多少类型的“盒模型” CSS有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆