本文介绍了flexbox vs表,为什么我们需要flexbox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 任何人都可以启发我如何新的Flexbox布局模型比当前表的方式更好? ( display:table and all those are included in my case )?Can anyone please enlighten me on how the new Flexbox layout model is any better than current tables way? (display:table and all those are includedin my case) ? IE10下不支持,不久的将来,我只是看不到任何好处超过表格布局。但是,互联网已经开始充满这种新的CSS方法的布局的崇拜者,所有的例子,我看到可以轻松地用正常的CSS没有问题。It's not supported at all under IE10 which isn't very good for the near future, and I just can't see any benefits over table layout. But still, the internet is starting to get full of "worshipers" of this new CSS method of layout, and all the examples I see can be easily done with normal css without problems. 更新25.12.15: 我已经使用flexbox,因为他们被介绍到现代浏览器并停止使用 display:table 等等,因为flexbox是更强大和易于使用。Update 25.12.15:I have been using flexboxes a lot since they were introduced to modern browsers and had stopped using display:table and so on, because flexboxes are more powerful and easy to use.推荐答案我可以想到使用flexbox和使用表格显示值或浮动布局页面有三个区别: p>There are three distinctions I can think of between using flexbox and using table display values or floats to layout a page: 无论HTML源顺序如何,都能重新排序元素,同时保持元素在正常流程中 - 您可以通过指定整数值与 订单 属性相匹配。 li> 它比传统浮动布局需要更少的打字(你不需要所有的伪元素用于清除目的),并且更具语义性,而使用浮动或表格布局显然不是。 通过使用 flex-grow 和 flex-shrink 属性。Being able to re-order elements irrespective of the HTML source order, while keeping elements in the normal flow - you can do this by specifying an integer value with the order property.It requires less typing than traditional float layouts (you don't need all of the pseudo-elements for clearing purposes) and is more semantic, while using floats or tables for layouts obviously isn't.The ability for flex-items to grow and shrink to fill horizontal and vertical space based on an ancestor elements' dimensions - by using the flex-grow and flex-shrink properties.你已经指出)是支持还是相当糟糕;实际上,Firefox仍然实现了一个旧版本的flexbox模块,所以你必须考虑到语法和行为的微小差异,这取决于你使用的是哪个浏览器。已经说了很多,但是,是布局的未来,特别是对于复杂的网络应用程序,弹出更频繁。这是值得学习,如果你没有做出一个不可避免的明智的投资 - 代价是不真正可用的现在。The problem (as you've pointed out) is that support is still pretty bad; In fact Firefox is still implementing an older version of the flexbox module, so you have to account for minor discrepancies in syntax and behavior, depending on which browser you're using. It has been said quite a bit, though, that it is the future for layouts, especially for complex web apps that are popping up more often. It's worth learning if you're okay with making an inevitably wise investment - at the cost of not really being useable right now.我还建议你看看这砸杂志文章友好介绍flexbox(它最近写的)I also suggest you take a look at this smashing magazine article for a friendly introduction to flexbox (it's fairly recently written) 这篇关于flexbox vs表,为什么我们需要flexbox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-14 08:33