你如何理解 CSS 盒模型(box model)?如何告诉浏览器使用不同的盒模型渲染?
Explain your understanding of the box model and how you would tell the browser in CSS to render your layout in different box models.
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: hard
分类: CSS Basics
标签: box model, margin, padding, border, content-box, border-box
参考答案摘要
答案 CSS 盒模型描述了文档树中元素生成的矩形盒子及其布局方式。每个盒子包含内容区(content),以及可选的 padding、border、margin。 盒模型负责计算: 块级元素占用多少空间 border/margin 是否重叠或折叠 盒子的尺寸(dimensions) 盒模型规则: 块元素尺寸由 width/height、padding、border、margin 共同决定 未指定 h...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。