css - Firefox 在 Angular Material 表单字段中添加了额外的空间
问题描述
我正在使用角度反应形式。其中一个表单字段使用日期选择器,它在 chrome 中看起来像这样。
为了修复它,我尝试bottom: 6px
在 dev-tools(firefox)中添加 mat-form-field-infix 并且它似乎有效。但是如果我在 chrome 中添加相同的属性,则 chrome 中的对齐会出错。知道我该如何解决这个问题吗?
解决方案
您可以添加 Firefox 浏览器特定的 CSS。
有两个选项可以包含在您的 CSS 文件中
使用@-moz-document url-prefix()
@-moz-document url-prefix() { .mat-form-field-label-wrapper { margin-top: -6px; } }
使用@supports (-moz-appearance:none)
@supports (-moz-appearance:none) { .mat-form-field-label-wrapper { margin-top: -6px; } }
推荐阅读
- python - 在特定条件下最后一次出现 Groupby 对象
- python - 基于 OpenAI Atari 中的操作的完成状态
- android - Android customlistview 反复滚动后崩溃
- arm - 在 uc/os-III 中进行上下文切换时内核寄存器布局错误
- ffmpeg - “AVIOContext”结构中“write_packet()/seek()”回调函数的return val是什么意思?
- java - 如何修复“IgniteCheckedException:查询执行失败:GridCacheQueryBean”?
- python - 无休止地打开和关闭网络摄像头?
- php - 如果帖子通过 get_posts() 动态获取,如何为帖子页面添加分页;
- kubernetes - 无法进入容器,rpc 错误:代码 = 5 desc ... shim-log.json:没有这样的文件或目录
- javascript - 使用来自另一个网站的发布请求启动 React 应用程序