html - html 规范是否说明同时指定 bottom 和 margin-bottom 时会发生什么?

标签 html css

对我来说,同时指定 bottommargin-bottom 似乎是矛盾的。因为两者都是指定元素与周围元素/容器之间缩进的方法。也就是说,bottom 应该从边框开始测量,否则它的缩进量是从缩进量开始的。有谁知道规范要说什么?

最佳答案

bottom 属性“指定框的底部边距边缘在框的包含 block 底部上方的偏移量” 1 。和

The margin edge surrounds the box margin. If the margin has 0 width, the margin edge is the same as the border edge. The four margin edges define the box's margin box."2

所以是的,规范说 bottom 是从边缘开始测量的。

关于html - html 规范是否说明同时指定 bottom 和 margin-bottom 时会发生什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23684740/

相关文章:

jquery - 为什么我的上一个/下一个按钮不适用于此 Bootstrap 轮播?

jquery - Materialise CSS 删除禁用的输入字段不起作用

html - 具有响应高度的表格单元格的圆形边框形状

HTML - 页脚不在底部

javascript - 限制段落字符的有效方法(垂直文本溢出)

html - R:使用 rvest 抓取动态链接

javascript - 创建 HTML 元素并在创建后添加动画

css - 为移动设备重新排列容器

javascript - 在 slideUp jQuery 上跳转

html - 如何使横跨网站宽度的 3 张图像具有响应性?