怪异模式(Quirks Mode)导致 button 和 input 的大小不统一原因

怪异模式(quirks mode)是指在计算机领域中,一些网页浏览器为了维持对较旧的网页设计的向后兼容性,而使用的一种技术。


怪异模式特点:

1.采用的是IE盒模型,即将border和padding包含在了height和width中。

在 IE 盒模型中,

box width = content width + padding left + padding right + border left + border right,
box height = content height + padding top + padding bottom + border top + border bottom,

在标准盒模型中,

box width = content width 
box height = content height



使用 box-sizing: content-box|border-box|inherit; 可以设置div为怪异模式。


参考:

https://blog.csdn.net/ErMiaoYY/article/details/83543522

https://blog.csdn.net/ErMiaoYY/article/details/83542700

https://www.ibm.com/developerworks/cn/web/1310_shatao_quirks/index.html

修改时间 2021-08-27

声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。
真诚赞赏,手留余香
赞赏
随机推荐
MySQL 表名预处理
CSS 媒体特性 prefers-color-scheme
get_categories() 获取所有分类
Node.js 使用 Jest 做单元测试
SQL 注入的生命力
WordPress 一键从HTTP转换到HTTPS
WordPress WP_Query() 文章置顶的方法
WordPress 的用户角色和权限