问题
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