Why does Visual Studio 2013 recognize CSS3 display: flexbox, but not flex?

牧云@^-^@ 提交于 2019-12-30 17:28:13

问题


On my CSS pages Visual Studio doesn't recognize flex, claiming it's not valid:

div {
    display: flex;
    display: inline-flex;
}

It does however recognize flexbox :

div {
    display: flexbox;
    display: inline-flexbox;
}

Flexbox does not seem to be supported in any of the main browsers, yet flex is. Can anyone explain this?

Thanks.


回答1:


VS2013 needs to have Update 5 installed and that will fix the CSS validation issue.




回答2:


flex and inline-flex were, at one point in time, flexbox and inline-flexbox respectively. The new values represent an entirely new definition of the Flexbox module, and browser implementations have moved on with these new values.

Either the old values were current at the time VS2013 was released, or if not, then VS2013 shipped with an out-of-date CSS validator.

Note that the W3C Jigsaw CSS validator has been updated to recognize the new values and consider the old values invalid.



来源:https://stackoverflow.com/questions/24124198/why-does-visual-studio-2013-recognize-css3-display-flexbox-but-not-flex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!