front-end-interview-handbook/packages/quiz/questions/have-you-played-around-with.../zh-CN.mdx

10 lines
582 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: 你玩过新的 CSS Flexbox 或 Grid 规范吗?
---
Flexbox 主要用于一维布局,而 Grid 用于二维布局。
Flexbox 解决了 CSS 中的许多常见问题,例如在容器内垂直居中元素、粘性页脚等。 著名的 CSS 框架,如 Bootstrap 和 Bulma 都基于 FlexboxFlexbox 仍然是创建布局的经过测试和验证的方法。
到目前为止Grid 是创建基于网格的布局最直观的方法,但目前浏览器支持范围并不广泛。 许多布局问题已经可以用 Flexbox 解决,因此对 Grid 的需求并不大。