front-end-interview-handbook/packages/quiz/questions/have-you-ever-used-a-grid-s.../zh-CN.mdx

10 lines
758 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: 你是否使用过网格系统,如果使用过,你更喜欢哪种?
---
在 Flex 变得流行之前(大约在 2014 年),基于 `float` 的网格系统是最可靠的因为它在现有的替代系统flex、grid中仍然拥有最多的浏览器支持。Bootstrap 一直使用 `float` 方法,直到 Bootstrap 4 切换到基于 `flex` 的方法。
如今,`flex` 是构建网格系统的推荐方法,并且具有 [不错的浏览器支持 (99.64%)](https://caniuse.com/#search=flex)。
对于喜欢冒险的人,他们可以研究 [CSS Grid Layout](https://css-tricks.com/snippets/css/complete-guide-grid/),它使用全新的 `grid` 属性。Grid 是一个基于二维网格的布局系统,而 Flexbox 是一维的。