front-end-interview-handbook/packages/quiz/questions/how-would-you-approach-fixi.../zh-CN.mdx

10 lines
692 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 您将如何解决特定于浏览器的样式问题?
---
* 在确定问题和有问题的浏览器后,使用仅在特定浏览器使用时加载的单独样式表。但是,此技术需要服务器端渲染。
* 使用 Bootstrap 等已经为您处理这些样式问题的库。
* 使用 `autoprefixer` 自动将供应商前缀添加到您的代码中。
* 使用 Reset CSS 或 Normalize.css。
* 如果您正在使用 PostCSS或类似的 CSS 转译库),可能存在允许您选择使用现代 CSS 语法(甚至 W3C 提案)的插件,这些插件会将代码的这些部分转换为等效的向后兼容代码,这些代码将在您使用的目标中起作用。